public class TimeUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DATETIME_A |
static int |
DATETIME_AV |
static int |
DATETIME_D |
static int |
DATETIME_DV |
static int |
DATETIME_H |
static int |
DATETIME_HV |
static int |
DATETIME_I |
static int |
DATETIME_IV |
static int |
DATETIME_M |
static int |
DATETIME_MV |
static int |
DATETIME_NONE
date-time part index constants
we consider a date-time as the following seven parts:
+------+-------+-----+---------------+------+--------+--------+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 |
+------+-------+-----+---------------+------+--------+--------+
| year | month | day | timing method | hour | minute | second |
+------+-------+-----+---------------+------+--------+--------+
and the numeric value before every part.
|
static int |
DATETIME_S |
static int |
DATETIME_SV |
static int |
DATETIME_Y |
static int |
DATETIME_YV |
| Constructor and Description |
|---|
TimeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static IWord[] |
createDateTimePool()
create and return a date-time pool
|
static void |
fillDateTimePool(IWord[] wPool,
int pIdx,
IWord word)
fill the date-time pool specified part with part index constant
|
static int |
fillDateTimePool(IWord[] wPool,
IWord word)
fill the date-time pool specified part through the specified
time entity string.
|
static void |
fillTimeToPool(IWord[] wPool,
String timeVal)
fill a date-time time part with a standard time format like '15:45:36'
to the specified time pool
|
static int |
getDateTimeIndex(String entity)
get and return the time part index of the specified IWord#entity
|
static String |
getTimeKey(int pIdx)
get and return the time key part with the part index value
|
static String |
getTimeKey(IWord word) |
static String |
getTimeKey(String entity)
get and return the time key part of the specified entity string
|
public static final int DATETIME_NONE
NLPSeg's date-time recognition base on this logic
1, the odd index is the entity part
2, the even index is the numeric value partpublic static final int DATETIME_YV
public static final int DATETIME_Y
public static final int DATETIME_MV
public static final int DATETIME_M
public static final int DATETIME_DV
public static final int DATETIME_D
public static final int DATETIME_AV
public static final int DATETIME_A
public static final int DATETIME_HV
public static final int DATETIME_H
public static final int DATETIME_IV
public static final int DATETIME_I
public static final int DATETIME_SV
public static final int DATETIME_S
public static final int getDateTimeIndex(String entity)
entity - public static final IWord[] createDateTimePool()
public static final int fillDateTimePool(IWord[] wPool, IWord word)
wPool - word - public static final void fillDateTimePool(IWord[] wPool, int pIdx, IWord word)
wPool - int - word - public static final String getTimeKey(String entity)
entity - public static final String getTimeKey(int pIdx)
int - Copyright © 2017. All Rights Reserved.