当前位置: 首页>>代码示例>>Java>>正文


Java MaltChainedException.printStackTrace方法代码示例

本文整理汇总了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;
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:21,代码来源:LWNode.java

示例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;
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:21,代码来源:LWEdge.java

示例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();
		}
	}
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:10,代码来源:ConcurrentExample2.java

示例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();
	}
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:37,代码来源:ParseSentence4.java

示例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();
//			}
//		}
	}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:15,代码来源:MaltParserRunnable.java

示例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();
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:14,代码来源:LWNode.java

示例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;
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:19,代码来源:LWNode.java

示例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;
}
 
开发者ID:jhamalt,项目名称:maltparser,代码行数:18,代码来源:LWEdge.java


注:本文中的org.maltparser.core.exception.MaltChainedException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。