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


Java StringArray.size方法代码示例

本文整理汇总了Java中org.apache.uima.jcas.cas.StringArray.size方法的典型用法代码示例。如果您正苦于以下问题:Java StringArray.size方法的具体用法?Java StringArray.size怎么用?Java StringArray.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.uima.jcas.cas.StringArray的用法示例。


在下文中一共展示了StringArray.size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSlotValues

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
public Collection<String> getSlotValues() {
	Collection<String> slotValuesToReturn = new ArrayList<String>();
	StringArray slotValues = wrappedSM.getSlotValues();
	for (int i = 0; i < slotValues.size(); i++) {
		slotValuesToReturn.add(slotValues.get(i));
	}
	return slotValuesToReturn;
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:9,代码来源:WrappedCCPStringSlotMention.java

示例2: swapDocumentInfo

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
public static void swapDocumentInfo(JCas fromJcas, GenericDocument toGD) {
	FSIterator docInfoIter = fromJcas.getJFSIndexRepository().getAnnotationIndex(CCPDocumentInformation.type)
			.iterator();
	// print document information
	String docID = "-1";
	int docCollectionID = -1;
	if (docInfoIter.hasNext()) {
		CCPDocumentInformation docInfo = (CCPDocumentInformation) docInfoIter.next();
		docID = docInfo.getDocumentID();
		docCollectionID = docInfo.getDocumentCollectionID();
		/* Get any secondary document IDs */
		StringArray secondaryIDsArray = docInfo.getSecondaryDocumentIDs();
		if (secondaryIDsArray != null) {
			for (int i = 0; i < secondaryIDsArray.size(); i++) {
				toGD.addSecondaryDocumentID(secondaryIDsArray.get(i));
			}
		}
	}

	toGD.setDocumentID(docID);
	toGD.setDocumentCollectionID(docCollectionID);

	// set the document text
	toGD.setDocumentText(fromJcas.getDocumentText());

	// add the annotations to the Generic Document
	// UIMA_Util uimaUtil = new UIMA_Util();
	List<TextAnnotation> annotations = getAnnotationsFromCas(fromJcas);
	toGD.setAnnotations(annotations);
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:31,代码来源:UIMA_Util.java

示例3: convertToCollection

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
private static Collection<String> convertToCollection(StringArray iArray) {
	Collection<String> iCollection = new ArrayList<String>();
	for (int i = 0; i < iArray.size(); i++) {
		iCollection.add(iArray.get(i));
	}
	return iCollection;
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:8,代码来源:UIMA_Util.java

示例4: indexOf

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
public static int indexOf(StringArray strArray, String strValue) {
	if (strArray == null) {
		return -1;
	}
	for (int i = 0; i < strArray.size(); i++) {
		if (strArray.get(i).equals(strValue)) {
			return i;
		}
	}
	return -1;
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:12,代码来源:UIMA_Util.java

示例5: getFirstSlotValue

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
public static String getFirstSlotValue(CCPStringSlotMention ccpSSM) {
	StringArray slotArray = ccpSSM.getSlotValues();
	if (slotArray != null && slotArray.size() > 0) {
		return slotArray.get(0);
	}
	return null;
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:8,代码来源:UIMA_Util.java

示例6: toList

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
public static List<String> toList(StringArray tokens) {
    List<String> l = new ArrayList<String>(tokens.size());
    for (int i = 0; i < tokens.size(); i++) {
        l.add(tokens.get(i));
    }
    return l;
}
 
开发者ID:BlueBrain,项目名称:bluima,代码行数:8,代码来源:BlueCasUtil.java

示例7: buildCssStyle

import org.apache.uima.jcas.cas.StringArray; //导入方法依赖的package包/类
/**
 * Create a CSS style string for the style annotation
 *
 * @param s
 *            the style
 * @return the string
 */
private String buildCssStyle(final Style s) {
	final String color = s.getColor();
	final StringArray decorations = s.getDecoration();
	final String font = s.getFont();

	// If no style info stop
	if (Strings.isNullOrEmpty(color) && Strings.isNullOrEmpty(font)
			&& (decorations == null || decorations.size() == 0)) {
		return null;
	}

	final StringBuilder sb = new StringBuilder();

	// This is very naive, it a passthrough of the original formats values
	// Effectively we are just hoping the browser knows what to do.

	if (!Strings.isNullOrEmpty(color)) {
		sb.append(String.format("color:%s; ", color));
	}

	if (!Strings.isNullOrEmpty(font)) {
		sb.append(String.format("font-family:\"%s\"; ", color));
	}

	if (decorations != null && decorations.size() > 0) {
		final String[] array = decorations.toArray();
		for (final String a : array) {
			switch (a.toUpperCase()) {
			case "UNDERLINE":
				sb.append("text-decoration:underline; ");
				break;
			case "BOLD":
				sb.append("font-weight:bold; ");
				break;
			case "ITALIC":
			case "ITALICS":
				sb.append("font-style:italic; ");
				break;
			case "STRIKE":
			case "STRIKETHROUGH":
				sb.append("text-decoration: line-through; ");
				break;
			case "SUPERSCRIPT":
				sb.append("font-size: .7em; vertical-align: super; ");
				break;
			case "SUBSCRIPT":
				sb.append("font-size: .7em; vertical-align: sub; ");
				break;
			case "BIG":
				sb.append("font-size: 1.2em; ");
				break;
			case "SMALL":
				sb.append("font-size: .9em; ");
				break;
			case "highlighted":
				sb.append("background-color:#ffffe0; ");
				break;
			default:
				// No nothing - we don't know what it means
				break;
			}
		}
	}

	return sb.toString();
}
 
开发者ID:dstl,项目名称:baleen,代码行数:74,代码来源:StructuralHtml.java


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