This is an automated email from the ASF dual-hosted git repository.
seanfinan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ctakes.git
The following commit(s) were added to refs/heads/main by this push:
new 76f09ab Use IdentifiedAnnotationBuilder
76f09ab is described below
commit 76f09ab444f88c6f1a9410f78710dbc84e38ed44
Author: Sean Finan <[email protected]>
AuthorDate: Mon Dec 19 23:38:30 2022 -0500
Use IdentifiedAnnotationBuilder
---
.../src/main/java/org/apache/ctakes/core/util/CalendarUtil.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git
a/ctakes-core/src/main/java/org/apache/ctakes/core/util/CalendarUtil.java
b/ctakes-core/src/main/java/org/apache/ctakes/core/util/CalendarUtil.java
index 83b5d90..7d4c3f5 100644
--- a/ctakes-core/src/main/java/org/apache/ctakes/core/util/CalendarUtil.java
+++ b/ctakes-core/src/main/java/org/apache/ctakes/core/util/CalendarUtil.java
@@ -1,6 +1,8 @@
package org.apache.ctakes.core.util;
+import org.apache.ctakes.core.util.annotation.IdentifiedAnnotationBuilder;
+import org.apache.ctakes.core.util.annotation.SemanticTui;
import org.apache.ctakes.typesystem.type.refsem.Date;
import org.apache.ctakes.typesystem.type.refsem.Time;
import org.apache.ctakes.typesystem.type.textsem.TimeMention;
@@ -60,6 +62,10 @@ final public class CalendarUtil {
static private final Collection<DateFormat> DATE_FORMATS = new
ArrayList<>();
static private final Collection<DateFormat> DATE_TIME_FORMATS = new
ArrayList<>();
+ static private final IdentifiedAnnotationBuilder _builder
+ = new IdentifiedAnnotationBuilder().creator( TimeMention::new )
+ .type( SemanticTui.T079 );
+
static {
for ( String date : DATE_FORMAT_CODES ) {
DATE_FORMATS.add( new SimpleDateFormat( date ) );
@@ -143,7 +149,7 @@ final public class CalendarUtil {
final Calendar calendar ) {
final Date date = createTypeDate( jCas, calendar );
final Time time = createTypeTime( jCas, calendar );
- final TimeMention timeMention = new TimeMention( jCas );
+ final TimeMention timeMention = (TimeMention)_builder.build( jCas );
timeMention.setDate( date );
timeMention.setTime( time );
// Right now there is only one time class.