CalendarUtil - apache/ctakes GitHub Wiki

final public class CalendarUtil

Can create TimeMention, Date, Time, and Calendar classes based upon text, annotations, etc.

  • Author: SPF , chip-nlp
  • Version: %I%
  • Since: 1/8/2019

static public TimeMention createTimeMention( final JCas jCas, final int begin, final int end )

  • Parameters:
    • jCas ye olde ...
    • begin begin index in doc text
    • end end index in doc text
  • Returns: TimeMention with normalized date and time and character offsets

static public TimeMention createTimeMention( final JCas jCas, final int begin, final int end, final Calendar calendar )

  • Parameters:
    • jCas ye olde ...
    • begin begin index in doc text
    • end end index in doc text
    • calendar some calendar with actual date information
  • Returns: TimeMention with normalized date and time and character offsets

static public TimeMention createTimeMention( final JCas jCas, final String text )

  • Parameters:
    • jCas ye olde ...
    • text doc text
  • Returns: TimeMention with normalized date and time and no character offsets

static public TimeMention createTimeMention( final JCas jCas, final Calendar calendar )

  • Parameters:
    • jCas ye olde ...
    • calendar some calendar with actual date information
  • Returns: TimeMention with normalized date and time and no character offsets

static public Date createTypeDate( final JCas jCas, final String text )

  • Parameters:
    • jCas ye olde ...
    • text some text representing actual date information
  • Returns: Type System Date with filled day, month, year values

static public Date createTypeDate( final JCas jCas, final Calendar calendar )

  • Parameters:
    • jCas ye olde ...
    • calendar some calendar with actual date information
  • Returns: Type System Date with filled day, month, year values

static public Time createTypeTime( final JCas jCas, final String text )

  • Parameters:
    • jCas ye olde ...
    • text some text representing actual time information
  • Returns: Type System Time with filled day, month, year values

static public Time createTypeTime( final JCas jCas, final Calendar calendar )

  • Parameters:
    • jCas ye olde ...
    • calendar some calendar with actual time information
  • Returns: Type System Time with filled day, month, year values

static public Calendar getCalendar( final Annotation annotation )

  • Parameters:
    • annotation -
  • Returns: Calendar parsed from annotation, or {@link #NULL_CALENDAR}.

static public Calendar getCalendar( final String text )

  • Parameters:
    • text -
  • Returns: Calendar parsed from text, or {@link #NULL_CALENDAR}.

static private Calendar getTimeMentionCalendar( final TimeMention timeMention )

  • Parameters:
    • timeMention -
  • Returns: Calendar created using preset date information in the TimeMention or its covered text, or {@link #NULL_CALENDAR}.

static private Calendar getCalendar( final Date typeDate )

  • Parameters:
    • typeDate Type System Date, usually in a {@link TimeMention}.
  • Returns: Calendar created using preset date information, or {@link #NULL_CALENDAR}.

static private int parseInt( final String text )

  • Parameters:
    • text -
  • Returns: positive int value of text or {@link Integer#MIN_VALUE} if not possible.
⚠️ **GitHub.com Fallback** ⚠️