Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
INB
Text Mining
Generic Tools
nlp-gate-generic-component
Commits
102085ac
Commit
102085ac
authored
Apr 05, 2022
by
jcorvi
Browse files
Merge branch 'develop' into 'master'
smaller term See merge request
!10
parents
0f685197
dc2977bf
Pipeline
#28780
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/es/bsc/inb/nlp/gate/generic/component/util/AnnotationUtil.java
View file @
102085ac
...
...
@@ -324,13 +324,18 @@ public class AnnotationUtil {
}
else
{
first
=
false
;
}
//add specimen to finding
Annotation
specimen
=
as
.
get
(
new
Integer
(
spe_id
));
specimen
.
getFeatures
().
put
(
template_value_name
,
getSendCode
(
specimen
,
gate
.
Utils
.
stringFor
(
doc
,
specimen
)));
specimen
.
getFeatures
().
put
(
send_code_name
,
getOnlySENDCode
(
specimen
,
gate
.
Utils
.
stringFor
(
doc
,
specimen
)));
specimen
.
getFeatures
().
put
(
send_codelist_name
,
getOnlySENDCodeList
(
specimen
,
gate
.
Utils
.
stringFor
(
doc
,
specimen
)));
specimen
.
getFeatures
().
put
(
"ANNOTATION_TYPE"
,
specimen
.
getType
());
doc
.
getAnnotations
(
annotationSetRelationExtraction
).
add
(
specimen
.
getStartNode
(),
specimen
.
getEndNode
(),
"FINDING_"
+
finding_id
,
specimen
.
getFeatures
());
try
{
//add specimen to finding
Annotation
specimen
=
as
.
get
(
new
Integer
(
spe_id
));
specimen
.
getFeatures
().
put
(
template_value_name
,
getSendCode
(
specimen
,
gate
.
Utils
.
stringFor
(
doc
,
specimen
)));
specimen
.
getFeatures
().
put
(
send_code_name
,
getOnlySENDCode
(
specimen
,
gate
.
Utils
.
stringFor
(
doc
,
specimen
)));
specimen
.
getFeatures
().
put
(
send_codelist_name
,
getOnlySENDCodeList
(
specimen
,
gate
.
Utils
.
stringFor
(
doc
,
specimen
)));
specimen
.
getFeatures
().
put
(
"ANNOTATION_TYPE"
,
specimen
.
getType
());
doc
.
getAnnotations
(
annotationSetRelationExtraction
).
add
(
specimen
.
getStartNode
(),
specimen
.
getEndNode
(),
"FINDING_"
+
finding_id
,
specimen
.
getFeatures
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
@@ -484,21 +489,6 @@ public class AnnotationUtil {
return
text
;
}
private
static
String
getValueFinding
(
Annotation
annotation
,
String
text
)
{
String
send_code
=
""
;
if
(
annotation
.
getFeatures
().
get
(
"MANUAL_SEND_CODE"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"MANUAL_SEND_CODE"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"CDISC_SEND_CODE"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"CDISC_SEND_CODE"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"ETOX_SEND_CODE"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"ETOX_SEND_CODE"
).
toString
();
}
if
(!
send_code
.
equals
(
""
))
{
return
text
+
"("
+
send_code
+
")"
;
}
return
text
;
}
private
static
String
getOnlySENDCodeList
(
Annotation
annotation
,
String
text
)
{
String
send_code
=
""
;
if
(
annotation
.
getFeatures
().
get
(
"MANUAL_CODELIST"
)!=
null
)
{
...
...
@@ -507,6 +497,8 @@ public class AnnotationUtil {
send_code
=
annotation
.
getFeatures
().
get
(
"CDISC_CODELIST"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"ETOX_CODELIST"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"ETOX_CODELIST"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"SMALLER_TERM_CODELIST"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"SMALLER_TERM_CODELIST"
).
toString
();
}
return
send_code
;
}
...
...
@@ -528,6 +520,8 @@ public class AnnotationUtil {
send_code
=
annotation
.
getFeatures
().
get
(
"ETOX_SEND_DOMAIN_CODE"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"MANUAL_SEND_DOMAIN_CODE"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"MANUAL_SEND_DOMAIN_CODE"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"SMALLER_TERM_SEND_DOMAIN_CODE"
)!=
null
){
send_code
=
annotation
.
getFeatures
().
get
(
"SMALLER_TERM_SEND_DOMAIN_CODE"
).
toString
();
}
return
send_code
;
}
...
...
@@ -547,6 +541,8 @@ public class AnnotationUtil {
send_code
=
annotation
.
getFeatures
().
get
(
"CDISC_SEND_CODE"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"ETOX_SEND_CODE"
)!=
null
)
{
send_code
=
annotation
.
getFeatures
().
get
(
"ETOX_SEND_CODE"
).
toString
();
}
else
if
(
annotation
.
getFeatures
().
get
(
"SMALLER_TERM_SEND_CODE"
)!=
null
){
send_code
=
annotation
.
getFeatures
().
get
(
"SMALLER_TERM_SEND_CODE"
).
toString
();
}
return
send_code
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment