Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
corpus-services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lange, Dr. Herbert
corpus-services
Commits
606a5b7f
Commit
606a5b7f
authored
3 years ago
by
Lange, Dr. Herbert
Browse files
Options
Downloads
Patches
Plain Diff
load annotation specification from resource
parent
9c4b7ffe
No related branches found
No related tags found
1 merge request
!6
add feature to load criteria file from resource and place all criteria files...
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/uni_hamburg/corpora/validation/quest/AnnotationChecker.java
+3
-2
3 additions, 2 deletions
...i_hamburg/corpora/validation/quest/AnnotationChecker.java
with
3 additions
and
2 deletions
src/main/java/de/uni_hamburg/corpora/validation/quest/AnnotationChecker.java
+
3
−
2
View file @
606a5b7f
...
@@ -73,14 +73,15 @@ abstract class AnnotationChecker extends Checker implements CorpusFunction {
...
@@ -73,14 +73,15 @@ abstract class AnnotationChecker extends Checker implements CorpusFunction {
/**
/**
* Loads the tags from an annotation specification file
* Loads the tags from an annotation specification file
* see https://exmaralda.org/en/utilities/ Templates for working with the Annotation Panel
* see https://exmaralda.org/en/utilities/ Templates for working with the Annotation Panel
* @param fileName the name of the annotation specification file
* @param fileName the name of the annotation specification file
as a resource
* @return the list of tags specified
* @return the list of tags specified
*/
*/
private
Collection
<
String
>
loadAnnotationSpecification
(
String
fileName
)
{
private
Collection
<
String
>
loadAnnotationSpecification
(
String
fileName
)
{
SAXBuilder
sb
=
new
SAXBuilder
();
SAXBuilder
sb
=
new
SAXBuilder
();
List
<
String
>
tags
=
new
ArrayList
<>();
List
<
String
>
tags
=
new
ArrayList
<>();
try
{
try
{
Document
dom
=
sb
.
build
(
new
File
(
fileName
));
//Document dom = sb.build(new File(fileName));
Document
dom
=
sb
.
build
(
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
fileName
));
List
<
Attribute
>
names
=
Collections
.
checkedList
(
XPath
.
newInstance
(
"//tag/@name"
).
selectNodes
(
dom
),
List
<
Attribute
>
names
=
Collections
.
checkedList
(
XPath
.
newInstance
(
"//tag/@name"
).
selectNodes
(
dom
),
Attribute
.
class
);
Attribute
.
class
);
// Extract attribute values and add them to the tags list
// Extract attribute values and add them to the tags list
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment