org.ansj.app.extracting.domain.ExtractingResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ansj_seg Show documentation
Show all versions of ansj_seg Show documentation
best java chinese word seg !
The newest version!
package org.ansj.app.extracting.domain;
import org.ansj.app.extracting.ExtractingTask;
import org.ansj.domain.Term;
import java.util.*;
/**
* Created by Ansj on 21/09/2017.
*/
public class ExtractingResult {
private List taskResults;
public synchronized void add(ExtractingTask task) {
if (taskResults == null) {
taskResults = new ArrayList<>();
}
taskResults.add(task);
}
public List> findAll(){
if (taskResults == null) {
return Collections.emptyList();
}
List> result = new ArrayList<>(taskResults.size());
RESULT:
for (ExtractingTask task : taskResults) {
List tempList = new ArrayList<>();
for (List list : task.getList()) {
if (list == null) {
continue RESULT;
}
for (Term term : list) {
tempList.add(term);
}
}
result.add(tempList);
}
return result ;
}
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy