public class CorpusLoader extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CorpusLoader.Handler |
static class |
CorpusLoader.HandlerThread
多线程任务
|
| Constructor and Description |
|---|
CorpusLoader() |
| Modifier and Type | Method and Description |
|---|---|
static Document |
convert2Document(File file) |
static List<Document> |
convert2DocumentList(String folderPath) |
static List<Document> |
convert2DocumentList(String folderPath,
boolean verbose)
读取整个目录中的人民日报格式语料
|
static List<List<IWord>> |
convert2SentenceList(String path) |
static List<List<Word>> |
convert2SimpleSentenceList(String path) |
static List<Document> |
loadCorpus(String path) |
static List<List<IWord>> |
loadSentenceList(String path) |
static boolean |
saveCorpus(List<Document> documentList,
String path) |
static boolean |
saveSentenceList(List<List<IWord>> sentenceList,
String path) |
static void |
walk(String folderPath,
CorpusLoader.Handler handler) |
static void |
walk(String folderPath,
CorpusLoader.HandlerThread[] threadArray) |
public static void walk(String folderPath, CorpusLoader.Handler handler)
public static void walk(String folderPath, CorpusLoader.HandlerThread[] threadArray)
public static List<Document> convert2DocumentList(String folderPath, boolean verbose)
folderPath - 路径verbose - public static boolean saveSentenceList(List<List<IWord>> sentenceList, String path)
Copyright © 2014–2021 码农场. All rights reserved.