public class TimeNLPUtil extends Object
Modifier and Type | Method and Description |
---|---|
static List<TimeNLP> |
parse(String text)
时间自然语言分析
|
static List<TimeNLP> |
parse(String text,
String timeBase)
时间自然语言分析
|
static List<TimeNLP> |
parse(String text,
String timeBase,
long timeout,
TimeUnit unit,
ExecutorService executorService)
时间自然语言分析,使用线程池并发执行
|
static List<TimeNLP> |
parseConcurrent(String text)
时间自然语言分析,使用线程池并发执行
|
static List<TimeNLP> |
parseConcurrent(String text,
long timeout,
TimeUnit unit)
时间自然语言分析,使用线程池并发执行,设置超时时间和单位
|
static List<TimeNLP> |
parseConcurrent(String text,
long timeout,
TimeUnit unit,
ExecutorService executorService)
时间自然语言分析,使用线程池并发执行,设置超时时间和单位,使用自定义线程池
|
static List<TimeNLP> |
parseConcurrentDefaultTime(String text)
时间自然语言分析,使用线程池并发执行,默认3秒超时
|
public static List<TimeNLP> parse(String text)
text
- 待分析文本public static List<TimeNLP> parseConcurrent(String text) throws InterruptedException, ExecutionException, TimeoutException
text
- 待分析文本InterruptedException
- 被中止异常ExecutionException
- 执行异常TimeoutException
- 超时异常public static List<TimeNLP> parseConcurrentDefaultTime(String text) throws InterruptedException, ExecutionException, TimeoutException
text
- 待分析文本InterruptedException
- 被中止异常ExecutionException
- 执行异常TimeoutException
- 超时异常public static List<TimeNLP> parseConcurrent(String text, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
text
- 待分析文本timeout
- 超时时间unit
- 超时时间单位InterruptedException
- 被中止异常ExecutionException
- 执行异常TimeoutException
- 超时异常public static List<TimeNLP> parseConcurrent(String text, long timeout, TimeUnit unit, ExecutorService executorService) throws InterruptedException, ExecutionException, TimeoutException
text
- 待分析文本timeout
- 超时时间unit
- 超时时间单位executorService
- 自定义线程池InterruptedException
- 被中止异常ExecutionException
- 执行异常TimeoutException
- 超时异常public static List<TimeNLP> parse(String text, String timeBase)
text
- 待分析文本timeBase
- 指定时间public static List<TimeNLP> parse(String text, String timeBase, long timeout, TimeUnit unit, ExecutorService executorService) throws InterruptedException, ExecutionException, TimeoutException
text
- 待分析文本timeBase
- 指定时间timeout
- 超时时间unit
- 超时时间单位executorService
- 自定义线程池InterruptedException
- 被中止异常ExecutionException
- 执行异常TimeoutException
- 超时异常Copyright © 2021. All rights reserved.