public class Utils extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Utils.FileSegmentationCallback |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
deleteDir(File dir)
删除目录
|
static String |
getTimeDes(Long ms)
根据毫秒数转换为自然语言表示的时间
|
static boolean |
isChineseCharAndLengthAtLeastOne(String word)
至少出现一次中文字符,且以中文字符开头和结束
|
static boolean |
isChineseCharAndLengthAtLeastTwo(String word)
至少出现两次中文字符,且以中文字符开头和结束
|
static void |
seg(File input,
File output,
boolean removeStopWords,
SegmentationAlgorithm segmentationAlgorithm)
对文件进行分词
|
static void |
seg(File input,
File output,
boolean removeStopWords,
SegmentationAlgorithm segmentationAlgorithm,
Utils.FileSegmentationCallback fileSegmentationCallback)
对文件进行分词
|
public static boolean isChineseCharAndLengthAtLeastOne(String word)
word - public static boolean isChineseCharAndLengthAtLeastTwo(String word)
word - public static boolean deleteDir(File dir)
dir - 目录public static void seg(File input, File output, boolean removeStopWords, SegmentationAlgorithm segmentationAlgorithm) throws Exception
input - 输入文件output - 输出文件removeStopWords - 是否移除停用词segmentationAlgorithm - 分词算法Exceptionpublic static void seg(File input, File output, boolean removeStopWords, SegmentationAlgorithm segmentationAlgorithm, Utils.FileSegmentationCallback fileSegmentationCallback) throws Exception
input - 输入文件output - 输出文件removeStopWords - 是否移除停用词segmentationAlgorithm - 分词算法fileSegmentationCallback - 分词结果回调ExceptionCopyright © 2014–2015 APDPlat. All rights reserved.