use of org.ansj.recognition.impl.StopRecognition in project ansj_seg by NLPchina.
the class StopLibrary method insertStopRegexes.
/**
* 正则过滤
*
* @param key
* @param regexes
*/
public static void insertStopRegexes(String key, String... regexes) {
StopRecognition fr = get(key);
fr.insertStopRegexes(regexes);
}
use of org.ansj.recognition.impl.StopRecognition in project ansj_seg by NLPchina.
the class StopLibrary method insertStopWords.
/**
* 增加停用词
*
* @param key
* @param regexes
*/
public static void insertStopWords(String key, List<String> stopWords) {
StopRecognition fr = get(key);
fr.insertStopWords(stopWords);
}
use of org.ansj.recognition.impl.StopRecognition in project ansj_seg by NLPchina.
the class StopLibrary method insertStopWords.
/**
* 增加停用词
*
* @param key
* @param regexes
*/
public static void insertStopWords(String key, String... stopWords) {
StopRecognition fr = get(key);
fr.insertStopWords(stopWords);
}
use of org.ansj.recognition.impl.StopRecognition in project ansj_seg by NLPchina.
the class AppTest method main.
public static void main(String[] args) throws IOException {
String stopDicStr = "6\n7\n龙";
StopRecognition testFilter = new StopRecognition();
BufferedReader br = new BufferedReader(new StringReader(stopDicStr));
String temp = null;
while ((temp = br.readLine()) != null) {
testFilter.insertStopWords(temp);
}
List<StopRecognition> filters = new ArrayList<StopRecognition>();
filters.add(testFilter);
for (int i = 0; i < 1; i++) {
StringReader reader = new StringReader("龙虎胶囊 6 * 7cm");
parse(new IndexAnalysis(reader), filters);
parse(new ToAnalysis(reader), filters);
parse(new DicAnalysis(reader), filters);
parse(new NlpAnalysis(reader), filters);
parse(new BaseAnalysis(reader), filters);
}
}
use of org.ansj.recognition.impl.StopRecognition in project ansj_seg by NLPchina.
the class StopLibrary method insertStopNatures.
/**
* 词性过滤
*
* @param key
* @param stopNatures
*/
public static void insertStopNatures(String key, String... filterNatures) {
StopRecognition fr = get(key);
fr.insertStopNatures(filterNatures);
}
Aggregations