本文整理汇总了Java中org.maltparser.core.exception.MaltChainedException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java MaltChainedException.printStackTrace方法的具体用法?Java MaltChainedException.printStackTrace怎么用?Java MaltChainedException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.maltparser.core.exception.MaltChainedException
的用法示例。
在下文中一共展示了MaltChainedException.printStackTrace方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLabelSet
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
/**
* Returns the label set.
*
* @return the label set.
*/
public LabelSet getLabelSet() {
SymbolTableHandler symbolTableHandler = getBelongsToGraph().getSymbolTables();
LabelSet labelSet = new LabelSet();
SortedSet<ColumnDescription> selectedColumns = graph.getDataFormat().getSelectedColumnDescriptions(labels.keySet());
for (ColumnDescription column : selectedColumns) {
try {
SymbolTable table = symbolTableHandler.getSymbolTable(column.getName());
int code = table.getSymbolStringToCode(labels.get(column.getPosition()));
labelSet.put(table, code);
} catch (MaltChainedException e) {
e.printStackTrace();
}
}
return labelSet;
}
示例2: getLabelSet
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
/**
* Returns the label set.
*
* @return the label set.
*/
public LabelSet getLabelSet() {
SymbolTableHandler symbolTableHandler = getBelongsToGraph().getSymbolTables();
LabelSet labelSet = new LabelSet();
for (ColumnDescription column : labels.keySet()) {
try {
SymbolTable table = symbolTableHandler.getSymbolTable(column.getName());
int code = table.getSymbolStringToCode(labels.get(column));
labelSet.put(table, code);
} catch (MaltChainedException e) {
e.printStackTrace();
}
}
return labelSet;
}
示例3: run
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
public void run() {
for (int i = 0; i < inputSentences.size(); i++) {
try {
outputSentences.add(model.parseTokens(inputSentences.get(i)));
} catch (MaltChainedException e) {
e.printStackTrace();
}
}
}
示例4: main
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
/**
* @param args
*/
public static void main(String[] args) {
try {
MaltParserService service = new MaltParserService();
// Inititalize the parser model 'model0' and sets the working directory to '.' and sets the logging file to 'parser.log'
service.initializeParserModel("-u jar:file:mco_nested_in_jar.jar!/model0.mco -m parse -w . -lfi parser.log -v debug");
// Creates an array of tokens, which contains the Swedish sentence 'Grundavdraget upphör alltså vid en taxerad inkomst på 52500 kr.'
// in the CoNLL data format.
String[] tokens = new String[11];
tokens[0] = "1\tGrundavdraget\t_\tN\tNN\tDD|SS";
tokens[1] = "2\tupphör\t_\tV\tVV\tPS|SM";
tokens[2] = "3\talltså\t_\tAB\tAB\tKS";
tokens[3] = "4\tvid\t_\tPR\tPR\t_";
tokens[4] = "5\ten\t_\tN\tEN\t_";
tokens[5] = "6\ttaxerad\t_\tP\tTP\tPA";
tokens[6] = "7\tinkomst\t_\tN\tNN\t_";
tokens[7] = "8\tpå\t_\tPR\tPR\t_";
tokens[8] = "9\t52500\t_\tR\tRO\t_";
tokens[9] = "10\tkr\t_\tN\tNN\t_";
tokens[10] = "11\t.\t_\tP\tIP\t_";
// Parses the Swedish sentence above
String[] outputTokens = service.parseTokens(tokens);
// Outputs the with the head index and dependency type information
for (int i = 0; i < outputTokens.length; i++) {
System.out.println(outputTokens[i]);
}
// Terminates the parser model
service.terminateParserModel();
} catch (MaltChainedException e) {
System.err.println("MaltParser exception: " + e.getMessage());
e.printStackTrace();
}
}
示例5: run
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
public void run() {
try {
outputSentences = model.parseSentences(inputSentences);
} catch (MaltChainedException e) {
e.printStackTrace();
}
// for (int i = 0; i < inputSentences.size(); i++) {
// try {
// outputSentences.add(model.parseTokens(inputSentences.get(i)));
// } catch (MaltChainedException e) {
// e.printStackTrace();
// }
// }
}
示例6: getOutgoingEdgeIterator
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
@Override
public Iterator<Edge> getOutgoingEdgeIterator() {
List<DependencyNode> dependents = getListOfDependents();
List<Edge> outEdges = new ArrayList<Edge>(dependents.size());
for (int i = 0; i < dependents.size(); i++) {
try {
outEdges.add(dependents.get(i).getHeadEdge());
} catch (MaltChainedException e) {
e.printStackTrace();
}
}
return outEdges.iterator();
}
示例7: getLabelTypes
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
/**
* Returns a set of symbol tables (labeling functions or label types) that labels the graph element.
*
* @return a set of symbol tables (labeling functions or label types)
*/
public Set<SymbolTable> getLabelTypes() {
Set<SymbolTable> labelTypes = new HashSet<SymbolTable>();
SymbolTableHandler symbolTableHandler = getBelongsToGraph().getSymbolTables();
SortedSet<ColumnDescription> selectedColumns = graph.getDataFormat().getSelectedColumnDescriptions(labels.keySet());
for (ColumnDescription column : selectedColumns) {
try {
labelTypes.add(symbolTableHandler.getSymbolTable(column.getName()));
} catch (MaltChainedException e) {
e.printStackTrace();
}
}
return labelTypes;
}
示例8: getLabelTypes
import org.maltparser.core.exception.MaltChainedException; //导入方法依赖的package包/类
/**
* Returns a set of symbol tables (labeling functions or label types) that labels the graph element.
*
* @return a set of symbol tables (labeling functions or label types)
*/
public Set<SymbolTable> getLabelTypes() {
Set<SymbolTable> labelTypes = new HashSet<SymbolTable>();
SymbolTableHandler symbolTableHandler = getBelongsToGraph().getSymbolTables();
for (ColumnDescription column : labels.keySet()) {
try {
labelTypes.add(symbolTableHandler.getSymbolTable(column.getName()));
} catch (MaltChainedException e) {
e.printStackTrace();
}
}
return labelTypes;
}