Class DateNormalization
java.lang.Object
org.opensextant.extractors.xtemporal.DateNormalization
- Author:
- ubaldino
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static int
static int
static int
static int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
format_date
(Date d) Format_date.static int
getIntValue
(String val) Gets the int value.static int
normalize_day
(Map<String, String> elements) Normalize_day.static int
normalize_month
(Map<String, String> elements) Normalize_month.static int
normalize_month_name
(Map<String, String> elements) Normalize_month_name.static org.joda.time.DateTimeZone
normalize_tz
(Map<String, String> elements) Z or Zulu is not always recognized as UTC / GMT+0000.static int
normalize_year
(Map<String, String> elements) Normalize_year.static void
normalizeDate
(Map<String, String> elements, DateMatch dt) For now this reports only DATE and standard TIME fields.static int
normalizeTime
(Map<String, String> elements, String tmField) Given a field hh, mm, or ss, get field from map and normalize/validate the value.
-
Field Details
-
INVALID_DATE
public static int INVALID_DATE -
INVALID_DAY
public static int INVALID_DAY -
NO_YEAR
public static int NO_YEAR -
NO_MONTH
public static int NO_MONTH -
NO_DAY
public static int NO_DAY
-
-
Constructor Details
-
DateNormalization
public DateNormalization()
-
-
Method Details
-
format_date
Format_date.- Parameters:
d
- date obj- Returns:
- formatted date
-
normalizeDate
For now this reports only DATE and standard TIME fields. Timezone is still- Parameters:
elements
- pattern fieldsdt
- found date- Throws:
ParseException
- the parse exception
-
normalize_tz
Z or Zulu is not always recognized as UTC / GMT+0000.- Parameters:
elements
- pattern fields- Returns:
- the date time zone
-
normalizeTime
Given a field hh, mm, or ss, get field from map and normalize/validate the value.- Parameters:
elements
- the elementstmField
- the tm field- Returns:
- the int
-
normalize_year
Normalize_year.- Parameters:
elements
- all matched fields- Returns:
- year fixed if possible, otherwise INVALID_DATE
-
normalize_month
Normalize_month.- Parameters:
elements
- the elements- Returns:
- the int
- Throws:
ParseException
- the parse exception
-
normalize_month_name
Normalize_month_name.- Parameters:
elements
- pattern fields- Returns:
- the month numeric
- Throws:
ParseException
- the parse exception
-
normalize_day
Normalize_day.- Parameters:
elements
- pattern fields- Returns:
- the int
-
getIntValue
Gets the int value.- Parameters:
val
- the val- Returns:
- the int value
-