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
ff7098e2
Commit
ff7098e2
authored
May 16, 2022
by
Lange, Dr. Herbert
Browse files
Options
Downloads
Patches
Plain Diff
implement function and update file to match super class
parent
e6675e13
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/ELANTranscriptionChecker.java
+26
-18
26 additions, 18 deletions
...rg/corpora/validation/quest/ELANTranscriptionChecker.java
with
26 additions
and
18 deletions
src/main/java/de/uni_hamburg/corpora/validation/quest/ELANTranscriptionChecker.java
+
26
−
18
View file @
ff7098e2
package
de.uni_hamburg.corpora.validation.quest
;
package
de.uni_hamburg.corpora.validation.quest
;
import
de.uni_hamburg.corpora.Corpus
;
import
de.uni_hamburg.corpora.CorpusData
;
import
de.uni_hamburg.corpora.CorpusData
;
import
de.uni_hamburg.corpora.ELANData
;
import
de.uni_hamburg.corpora.ELANData
;
import
de.uni_hamburg.corpora.Report
;
import
de.uni_hamburg.corpora.utilities.quest.XMLTools
;
import
de.uni_hamburg.corpora.utilities.quest.XMLTools
;
import
org.exmaralda.partitureditor.fsm.FSMException
;
import
org.exmaralda.partitureditor.jexmaralda.JexmaraldaException
;
import
org.jdom.Document
;
import
org.jdom.Document
;
import
org.jdom.Element
;
import
org.jdom.Element
;
import
org.jdom.JDOMException
;
import
org.jdom.JDOMException
;
import
org.jdom.xpath.XPath
;
import
org.jdom.xpath.XPath
;
import
org.xml.sax.SAXException
;
import
javax.xml.parsers.ParserConfigurationException
;
import
javax.xml.transform.TransformerException
;
import
javax.xml.xpath.XPathExpressionException
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
...
@@ -20,14 +31,22 @@ public class ELANTranscriptionChecker extends TranscriptionChecker {
...
@@ -20,14 +31,22 @@ public class ELANTranscriptionChecker extends TranscriptionChecker {
private
final
Logger
logger
=
Logger
.
getLogger
(
getFunction
());
private
final
Logger
logger
=
Logger
.
getLogger
(
getFunction
());
private
final
Set
<
String
>
tierIds
=
new
HashSet
<>();
public
ELANTranscriptionChecker
(
Properties
properties
)
{
public
ELANTranscriptionChecker
(
Properties
properties
)
{
super
(
properties
);
super
(
properties
);
logger
.
info
(
"PROPS: "
+
props
);
if
(
properties
.
containsKey
(
"transcription-tiers"
))
{
}
tierIds
.
addAll
(
Arrays
.
asList
(
properties
.
getProperty
(
"transcription-tiers"
).
split
(
","
)));
@Override
public
Report
function
(
Corpus
c
,
Boolean
fix
)
throws
NoSuchAlgorithmException
,
ClassNotFoundException
,
FSMException
,
URISyntaxException
,
SAXException
,
IOException
,
ParserConfigurationException
,
JexmaraldaException
,
TransformerException
,
XPathExpressionException
,
JDOMException
{
Report
report
=
new
Report
();
if
(
props
.
containsKey
(
"transcription-tier-pattern"
))
{
Properties
properties
=
new
Properties
(
props
);
properties
.
put
(
"tier-pattern"
,
props
.
getProperty
(
"transcription-tier-pattern"
));
ELANTierFinder
etf
=
new
ELANTierFinder
(
props
);
report
.
merge
(
etf
.
function
(
c
,
fix
));
}
}
report
.
merge
(
super
.
function
(
c
,
fix
));
return
report
;
}
}
@Override
@Override
...
@@ -56,21 +75,10 @@ public class ELANTranscriptionChecker extends TranscriptionChecker {
...
@@ -56,21 +75,10 @@ public class ELANTranscriptionChecker extends TranscriptionChecker {
else
if
(
props
.
containsKey
(
"transcription-method"
)
&&
else
if
(
props
.
containsKey
(
"transcription-method"
)
&&
props
.
getProperty
(
"transcription-method"
).
equalsIgnoreCase
(
"hiat"
))
{
props
.
getProperty
(
"transcription-method"
).
equalsIgnoreCase
(
"hiat"
))
{
logger
.
info
(
"HIAT"
);
logger
.
info
(
"HIAT"
);
tiers
=
Collections
.
checkedList
(
XPath
.
newInstance
(
"//TIER[@LINGUISTIC_TYPE_REF=\"v\"]"
).
selectNodes
(
dom
),
tiers
.
addAll
(
Collections
.
checkedList
(
XPath
.
newInstance
(
"//TIER[@LINGUISTIC_TYPE_REF=\"v\"]"
).
selectNodes
(
dom
),
Element
.
class
);
Element
.
class
)
)
;
}
}
return
tiers
;
return
tiers
;
}
}
@Override
String
getTranscriptionText
(
Element
tier
)
{
return
XMLTools
.
showAllText
(
tier
);
}
@Override
public
Map
<
String
,
String
>
getParameters
()
{
Map
<
String
,
String
>
params
=
super
.
getParameters
();
params
.
put
(
"transcription-tiers"
,
"List of transcription tier IDs separated by commas"
);
return
params
;
}
}
}
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