• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TypeDescription类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.uima.resource.metadata.TypeDescription的典型用法代码示例。如果您正苦于以下问题:Java TypeDescription类的具体用法?Java TypeDescription怎么用?Java TypeDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeDescription类属于org.apache.uima.resource.metadata包,在下文中一共展示了TypeDescription类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildConceptMapperDescription

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
/**
 * Returns an {@link AnalysisEngineDescription} initialized using the input configuration data.
 * The base of the description is loaded from the ConceptMapperOffsetTokenizer.xml descriptor
 * file that is part of the ConceptMapper distribution. Parameter settings in that file are
 * overridden by those set in the input configuration data.
 * 
 * @param tsd
 * @param configurationData
 * @return
 * @throws UIMAException
 * @throws IOException
 */
public static AnalysisEngineDescription buildConceptMapperDescription(TypeSystemDescription tsd,
		Object[] configurationData) throws UIMAException, IOException {
	AnalysisEngineDescription description = AnalysisEngineFactory.createAnalysisEngineDescription(
			CONCEPT_MAPPER_DESCRIPTOR_PATH, configurationData);
	TypeSystemDescription cmTypeSystem = description.getAnalysisEngineMetaData().getTypeSystem();

	/*
	 * The ConceptMapper Descriptor defines the uima.tt.TokenAnnotation type so we extract it
	 * and add it to the input type system
	 */
	TypeDescription tokenAnnotationTypeDesc = cmTypeSystem.getType("uima.tt.TokenAnnotation");
	List<TypeDescription> types = new ArrayList<TypeDescription>(Arrays.asList(tsd.getTypes()));
	types.add(tokenAnnotationTypeDesc);

	TypeSystemDescription tsdToUse = TypeSystemDescriptionFactory.createTypeSystemDescription();
	tsdToUse.setTypes(types.toArray(new TypeDescription[types.size()]));
	description.getAnalysisEngineMetaData().setTypeSystem(tsdToUse);
	return description;
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:32,代码来源:ConceptMapperFactory.java


示例2: testGetTypeSystem

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void testGetTypeSystem() throws ResourceInitializationException,
        InvalidXMLException, SAXException, IOException, ParserConfigurationException {
    TypeSystemDescription typeSystem = XmiFileTreeCorpusDAO
            .getTypeSystem(corpusPathString);
    typeSystem.resolveImports();

    Set<String> typeNames = new HashSet<String>();
    for (TypeDescription type : typeSystem.getTypes()) {
        typeNames.add(type.getName());
    }

    assertEquals(Sets.newHashSet(
            "com.textocat.textokit.commons.DocumentMetadata",
            "ru.kfu.itis.issst.evex.Person",
            "ru.kfu.itis.issst.evex.Organization",
            "ru.kfu.itis.issst.evex.Artifact",
            "ru.kfu.itis.issst.evex.Weapon", "ru.kfu.itis.issst.evex.Job",
            "ru.kfu.itis.issst.evex.Time", "ru.kfu.itis.issst.evex.Event",
            "ru.kfu.itis.issst.evex.Die",
            "ru.kfu.itis.issst.evex.StartPosition"), typeNames);
}
 
开发者ID:textocat,项目名称:textokit-core,代码行数:23,代码来源:XmiFileTreeCorpusDAOTest.java


示例3: createMultiLinkWithRoleTestTypeSytem

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
public static TypeSystemDescription createMultiLinkWithRoleTestTypeSytem()
    throws Exception
{
    List<TypeSystemDescription> typeSystems = new ArrayList<>();

    TypeSystemDescription tsd = new TypeSystemDescription_impl();

    // Link type
    TypeDescription linkTD = tsd.addType(LINK_TYPE, "", CAS.TYPE_NAME_TOP);
    linkTD.addFeature("role", "", CAS.TYPE_NAME_STRING);
    linkTD.addFeature("target", "", Token.class.getName());

    // Link host
    TypeDescription hostTD = tsd.addType(HOST_TYPE, "", CAS.TYPE_NAME_ANNOTATION);
    hostTD.addFeature("links", "", CAS.TYPE_NAME_FS_ARRAY, linkTD.getName(), false);

    typeSystems.add(tsd);
    typeSystems.add(TypeSystemDescriptionFactory.createTypeSystemDescription());

    return CasCreationUtils.mergeTypeSystems(typeSystems);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:22,代码来源:DiffUtils.java


示例4: testGettersAndSetters

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void testGettersAndSetters() throws Exception {
    ExternalAnnotator externalAnnotator = new ExternalAnnotator("ExampleAnnotator", ExampleAnnotator.class.getName());
    assertNotNull(externalAnnotator);
    assertTrue(externalAnnotator.getName().startsWith("ExampleAnnotator"));

    externalAnnotator.setName("BobExample");
    assertTrue(externalAnnotator.getName().startsWith("BobExample"));

    LeoTypeSystemDescription typeSystemDescription = new ExampleAnnotator().getLeoTypeSystemDescription();
    externalAnnotator.addTypeSystemDescription(typeSystemDescription);
    LeoTypeSystemDescription externalTypeSystem = externalAnnotator.getLeoTypeSystemDescription();
    assertNotNull(externalTypeSystem);
    for(TypeDescription typeDescription : externalTypeSystem.getTypes()) {
        TypeDescription exampleType = typeSystemDescription.getType(typeDescription.getName());
        if(exampleType == null)
            System.out.println(typeDescription.getName() + " was not found in ExampleAnnotator type system.");
        else
            System.out.println(typeDescription.getName() + " was found!");
        assertNotNull(exampleType);
    }
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:23,代码来源:ExternalAnnotatorTest.java


示例5: addType

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
/**
 * Add an Annotation Type to the TypeSystem from the TypeDescription provided.  If a type with
 * the same name already exists then the type will not be added.
 *
 * @param aTypeDescription The type to be added
 * @return Reference pointer to this LeoTypeSystemDescription object, used in the builder pattern
 */
public LeoTypeSystemDescription addType(TypeDescription aTypeDescription) {
    if (aTypeDescription == null) {
        return this;
    }//if

    if (this.myTypeSystemDescription == null) {
        this.myTypeSystemDescription = TypeSystemFactory.generateTypeSystemDescription();
    }

    if (this.myTypeSystemDescription.getType(aTypeDescription.getName()) != null) {
        return this;
    }//if

    //Add the type and associated features to the TypeSystem
    this.myTypeSystemDescription.addType(aTypeDescription.getName(), aTypeDescription.getDescription(), aTypeDescription.getSupertypeName());
    TypeDescription newTd = this.myTypeSystemDescription.getType(aTypeDescription.getName());
    for (FeatureDescription fd : aTypeDescription.getFeatures()) {
        newTd.addFeature(fd.getName(), fd.getDescription(), fd.getRangeTypeName(), fd.getElementType(), fd.getMultipleReferencesAllowed());
    }//for

    return this;
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:30,代码来源:LeoTypeSystemDescription.java


示例6: testTypeSystemConstructors

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void testTypeSystemConstructors() throws Exception {
	LeoTypeSystemDescription ftsd0 = new LeoTypeSystemDescription("desc.gov.va.vinci.leo.types.TestTypeSystem", true);
	assertNotNull(ftsd0);
	TypeDescription td0 = ftsd0.getType("gov.va.vinci.leo.types.TestType");
	assertNotNull(td0);
	FeatureDescription[] features = td0.getFeatures();
	assertTrue(features.length > 0);
	assertTrue("name".equals(features[0].getName()));
	
	String testType1 = "gov.va.vinci.leo.types.TestType1";
	LeoTypeSystemDescription ftsd1
		= new LeoTypeSystemDescription(testType1,
										"Test Type 1", 
										"uima.tcas.Annotation");
	assertNotNull(ftsd1);
	TypeDescription td1 = ftsd1.getType(testType1);
	assertNotNull(td1);
	
	LeoTypeSystemDescription ftsd2 = new LeoTypeSystemDescription(td1);
	assertNotNull(ftsd2);
	
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:24,代码来源:LeoTypeSystemDescriptionTest.java


示例7: simpleTest3

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void simpleTest3() throws Exception, IOException {
	TypeDescription t = TypeDescriptionBuilder
								.create("gov.va.vinci.Ryan", "Test", "uima.tcas.Annotation")
								.addFeature("myFeature", "Cool Feature!", "String")
								.getTypeDescription();
	
	StringWriter w = new StringWriter();
	t.toXML(w);
	
	assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
			 	"<typeDescription xmlns=\"http://uima.apache.org/resourceSpecifier\">" +
			 	"    <name>gov.va.vinci.Ryan</name>" +
			 	"    <description>Test</description>" +
			 	"    <supertypeName>uima.tcas.Annotation</supertypeName>" +
			 	"    <features>" +
		        "        <featureDescription>" +
		        "            <name>myFeature</name>" +
		        "            <description>Cool Feature!</description>" +
		        "            <rangeTypeName>String</rangeTypeName>" +
		        "        </featureDescription>" +
		        "    </features>" +
				"</typeDescription>", w.toString().replaceAll("\r\n", "").replaceAll("\n", ""));
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:25,代码来源:TypeDescriptionBuilderTest.java


示例8: simpleTest4

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void simpleTest4() throws Exception, IOException {
	TypeDescription t = TypeDescriptionBuilder
								.create("gov.va.vinci.Ryan", "Test", "uima.tcas.Annotation")
								.addFeature("myFeature", "Cool Feature!", "String", "LString", true)
								.getTypeDescription();
	
	StringWriter w = new StringWriter();
	t.toXML(w);
	
	assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
			 	"<typeDescription xmlns=\"http://uima.apache.org/resourceSpecifier\">" +
			 	"    <name>gov.va.vinci.Ryan</name>" +
			 	"    <description>Test</description>" +
			 	"    <supertypeName>uima.tcas.Annotation</supertypeName>" +
			 	"    <features>" +
		        "        <featureDescription>" +
		        "            <name>myFeature</name>" +
		        "            <description>Cool Feature!</description>" +
		        "            <rangeTypeName>String</rangeTypeName>" +
		        "            <elementType>LString</elementType>" +
		        "            <multipleReferencesAllowed>true</multipleReferencesAllowed>" +
		        "        </featureDescription>" +
		        "    </features>" +
				"</typeDescription>", w.toString().replaceAll("\r\n", "").replaceAll("\n", ""));
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:27,代码来源:TypeDescriptionBuilderTest.java


示例9: testFail

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void testFail()
    throws Exception
{
    TypeSystemDescription tsd = UIMAFramework.getResourceSpecifierFactory()
            .createTypeSystemDescription();
    
    String refTypeName = "RefType";
    
    TypeDescription refTypeDesc = tsd.addType(refTypeName, null, CAS.TYPE_NAME_ANNOTATION);
    refTypeDesc.addFeature("ref", null, CAS.TYPE_NAME_ANNOTATION);
    
    CAS cas = CasCreationUtils.createCas(tsd, null, null);
    
    Type refType = cas.getTypeSystem().getType(refTypeName);
    
    // A regular index annotation
    AnnotationFS anno1 = cas.createAnnotation(cas.getAnnotationType(), 0, 1);
    cas.addFsToIndexes(anno1);

    // A non-index annotation but reachable through an indexe one (below)
    AnnotationFS anno2 = cas.createAnnotation(cas.getAnnotationType(), 0, 1);

    // An indexed annotation that references the non-indexed annotation above
    AnnotationFS anno3 = cas.createAnnotation(refType, 0, 1);
    anno3.setFeatureValue(refType.getFeatureByBaseName("ref"), anno2);
    cas.addFsToIndexes(anno3);
    
    List<LogMessage> messages = new ArrayList<>();
    CasDoctor cd = new CasDoctor(AllFeatureStructuresIndexedCheck.class);
    // A project is not required for this check
    boolean result = cd.analyze(null, cas, messages);
    
    messages.forEach(System.out::println);
    
    assertFalse(result);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:38,代码来源:AllAnnotationsIndexedCheckTest.java


示例10: testOK

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Test
public void testOK()
    throws Exception
{
    TypeSystemDescription tsd = UIMAFramework.getResourceSpecifierFactory()
            .createTypeSystemDescription();
    
    String refTypeName = "RefType";
    
    TypeDescription refTypeDesc = tsd.addType(refTypeName, null, CAS.TYPE_NAME_ANNOTATION);
    refTypeDesc.addFeature("ref", null, CAS.TYPE_NAME_ANNOTATION);
    
    CAS cas = CasCreationUtils.createCas(tsd, null, null);
    
    Type refType = cas.getTypeSystem().getType(refTypeName);
    
    // A regular index annotation
    AnnotationFS anno1 = cas.createAnnotation(cas.getAnnotationType(), 0, 1);
    cas.addFsToIndexes(anno1);

    // An indexed annotation but reachable through an indexe one (below)
    AnnotationFS anno2 = cas.createAnnotation(cas.getAnnotationType(), 0, 1);
    cas.addFsToIndexes(anno2);

    // An indexed annotation that references the non-indexed annotation above
    AnnotationFS anno3 = cas.createAnnotation(refType, 0, 1);
    anno3.setFeatureValue(refType.getFeatureByBaseName("ref"), anno2);
    cas.addFsToIndexes(anno3);
    
    List<LogMessage> messages = new ArrayList<>();
    CasDoctor cd = new CasDoctor(AllFeatureStructuresIndexedCheck.class);
    // A project is not required for this check
    boolean result = cd.analyze(null, cas, messages);
    
    messages.forEach(System.out::println);
    
    assertTrue(result);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:39,代码来源:AllAnnotationsIndexedCheckTest.java


示例11: generateFeature

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
private void generateFeature(TypeSystemDescription aTSD, TypeDescription aTD,
        AnnotationFeature aFeature)
{
    switch (aFeature.getMultiValueMode()) {
    case NONE:
        if (aFeature.isVirtualFeature()) {
            aTD.addFeature(aFeature.getName(), "", CAS.TYPE_NAME_STRING);
        }
        else {
            aTD.addFeature(aFeature.getName(), "", aFeature.getType());
        }
        break;
    case ARRAY: {
        switch (aFeature.getLinkMode()) {
        case WITH_ROLE: {
            // Link type
            TypeDescription linkTD = aTSD.addType(aFeature.getLinkTypeName(), "",
                    CAS.TYPE_NAME_TOP);
            linkTD.addFeature(aFeature.getLinkTypeRoleFeatureName(), "", CAS.TYPE_NAME_STRING);
            linkTD.addFeature(aFeature.getLinkTypeTargetFeatureName(), "", aFeature.getType());
            // Link feature
            aTD.addFeature(aFeature.getName(), "", CAS.TYPE_NAME_FS_ARRAY, linkTD.getName(),
                    false);
            break;
        }
        default:
            throw new IllegalArgumentException("Unsupported link mode ["
                    + aFeature.getLinkMode() + "] on feature [" + aFeature.getName() + "]");
        }
        break;
    }
    default:
        throw new IllegalArgumentException("Unsupported multi-value mode ["
                + aFeature.getMultiValueMode() + "] on feature [" + aFeature.getName() + "]");
    }
}
 
开发者ID:webanno,项目名称:webanno,代码行数:37,代码来源:AnnotationSchemaServiceImpl.java


示例12: getIteratedTypeDescriptions

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
public List<TypeDescription> getIteratedTypeDescriptions() {
	List<TypeDescription> list = new ArrayList<>();
	list.add(mainIteratedType);
	for(TypeDescription td: typesByShortcut.values()) {
		if(td.getName().equals(mainIteratedType.getName()))
			continue;
		list.add(td);
	}
	return list;
}
 
开发者ID:nantesnlp,项目名称:uima-tokens-regex,代码行数:11,代码来源:AutomataParserListener.java


示例13: toFeature

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
private Feature toFeature(FeatureNameContext featName, ParserRuleContext ctx) {
		TypeDescription baseType = mainIteratedType;
		String featureBaseName = featName.getText();

//		// TODO fix grammar because this is always null
//		if(featName.typeShortName() != null) {
//			TypeDescription typeDescription = typesByShortcut.get(featName.typeShortName().getText());
//			if(typeDescription != null)
//				baseType = typeDescription;
//			else
//				throw new AutomataParsingException(String.format("Unknown type <%s> for feature <%s>", featName.typeShortName().getText(), featName.getText()));
//		}

		String string = featName.getText();
		int dot = string.lastIndexOf('.');
		if(dot >0 ) {
			String typeShortname = string.substring(0, dot);
			TypeDescription typeDescription = typesByShortcut.get(typeShortname);
			if(typeDescription != null) {
				baseType = typeDescription;
				featureBaseName = string.substring(dot+1);
			}
		}


		Optional<Feature> featureDescription = findFeatureDescription(toType(baseType), featureBaseName);
		if(featureDescription.isPresent())
			return featureDescription.get();
		else
			return throwException(ctx, String.format("No feature named <%s> for type <%s>", featName.getText(), baseType.getName()));
	}
 
开发者ID:nantesnlp,项目名称:uima-tokens-regex,代码行数:32,代码来源:AutomataParserListener.java


示例14: populateTypeMatchers

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
private void populateTypeMatchers() {
	Type mainType = toType(mainIteratedType);
	typeMatchers.put(mainType.getName(), new TypeMatcher(getTypeSystem(), mainType));
	typeMatchers.put(mainType.getShortName(), new TypeMatcher(getTypeSystem(), mainType));
	for(Map.Entry<String, TypeDescription> e:typesByShortcut.entrySet()) {
		Type type = toType(e.getValue());
		typeMatchers.put(e.getKey(), new TypeMatcher(getTypeSystem(), type));
		typeMatchers.put(type.getName(), new TypeMatcher(getTypeSystem(), type));
		typeMatchers.put(type.getShortName(), new TypeMatcher(getTypeSystem(), type));
	}
}
 
开发者ID:nantesnlp,项目名称:uima-tokens-regex,代码行数:12,代码来源:AutomataParserListener.java


示例15: createTestCas

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
public static JCas createTestCas(String documentString) {
	String tsPath = Paths.get("src", "test", "resources", "TestTypeSystem.xml").toString();
	TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath(tsPath);
	
	for(TypeDescription td:tsd.getTypes()) {
		System.out.println(td);
	}
	
	
	try {
		JCas cas = JCasFactory.createJCas(tsd);
		cas.setDocumentText(documentString);
		StringBuffer buffer = new StringBuffer();
		int lastBegin = 0;
		boolean inWord = false;
		int i;
		for(i = 0 ; i < documentString.length() ; i++) {
			if(Character.isWhitespace(documentString.charAt(i))) {
				if(inWord) {
					createAnno(cas, lastBegin, i, buffer.toString());
					inWord = false;
				}
			} else {
				if(!inWord) {
					lastBegin = i;
					buffer = new StringBuffer();
					inWord = true;
				}
				buffer.append(documentString.charAt(i));
			}
		}
		if(inWord)
			createAnno(cas, lastBegin, i, buffer.toString());
		return cas;
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:nantesnlp,项目名称:uima-tokens-regex,代码行数:39,代码来源:Fixtures.java


示例16: getLeoTypeSystemDescription

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
/**
 * Create the Annotation Type System for the the Annotator.
 *
 * @param type String that is the Parent type
 * @return LeoTypeSystemDescription object with the specific types.
 */
public LeoTypeSystemDescription getLeoTypeSystemDescription(String type) {
    TypeDescription parentAnnotation = new TypeDescription_impl(type, "", "uima.tcas.Annotation");
    parentAnnotation.addFeature("Experiencer", "", "uima.cas.String");
    parentAnnotation.addFeature("ExperiencerPattern", "", "uima.cas.String");
    parentAnnotation.addFeature("Negation", "", "uima.cas.String");
    parentAnnotation.addFeature("NegationPattern", "", "uima.cas.String");
    parentAnnotation.addFeature("Temporality", "", "uima.cas.String");
    parentAnnotation.addFeature("TemporalityPattern", "", "uima.cas.String");
    parentAnnotation.addFeature("Window", "", "uima.tcas.Annotation");

    LeoTypeSystemDescription ftsd = new LeoTypeSystemDescription();
    ftsd.addType(parentAnnotation);
    return ftsd;
}
 
开发者ID:Blulab-Utah,项目名称:ConText,代码行数:21,代码来源:BaseContextAnnotator.java


示例17: checkCollection

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
public void checkCollection(XmiFileCollectionReader xfsr) throws Exception {
    assertNotNull(xfsr);
    assertTrue(xfsr.hasNext());
    assertEquals(2, xfsr.getCollectionSize());
    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(simpleServiceDefinition().getAnalysisEngineDescription());
    TypeDescription[] ar = ae.getAnalysisEngineMetaData().getTypeSystem().getTypes();
    JCas mockCas = ae.newJCas();
    xfsr.getNext(mockCas.getCas());
    //System.out.println(mockCas.getDocumentText());
    assertTrue(mockCas.getDocumentText().startsWith("this"));
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:12,代码来源:XmiFileCollectionReaderTest.java


示例18: getLeoTypeSystemDescription

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
@Override
public LeoTypeSystemDescription getLeoTypeSystemDescription() {
    TypeDescription token = new TypeDescription_impl("gov.va.vinci.leo.whitespace.types.Token", "", "uima.tcas.Annotation");
    token.addFeature("TokenType", "", "uima.cas.Integer");

    LeoTypeSystemDescription ftsd = new LeoTypeSystemDescription();
    try {
        ftsd.addType(token)
                .addType("gov.va.vinci.leo.whitespace.types.WordToken", "Annotates collections of letters", "uima.tcas.Annotation");
    } catch (Exception e) {
        logger.warn("Exception occurred generating WhitespaceTypeSystem", e);
        throw new RuntimeException(e);
    }//catch
    return ftsd;
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:16,代码来源:WhitespaceTokenizer.java


示例19: LeoTypeSystemDescription

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
/**
 * Create an initial, empty TypeSystemDescription. Optionally a list of TypeDescription objects
 * can also be provided which will be added to the new TypeSystemDescription.
 *
 * @param types Optional, TypeDescription objects to be added to the TypeSystem
 */
public LeoTypeSystemDescription(TypeDescription... types) {
    this(TypeSystemFactory.generateTypeSystemDescription());
    //Add the types if the parameters are provided
    for (TypeDescription td : types) {
        this.addType(td);
    }//for

}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:15,代码来源:LeoTypeSystemDescription.java


示例20: addTypeSystemDescription

import org.apache.uima.resource.metadata.TypeDescription; //导入依赖的package包/类
/**
 * Add the TypeSystem provided to the existing Type System.
 *
 * @param aLeoTypeSystemDescription TypeSystemDescription to be added to this one.
 * @return Reference pointer to this LeoTypeSystemDescription object, for the builder pattern.
 */
public LeoTypeSystemDescription addTypeSystemDescription(LeoTypeSystemDescription aLeoTypeSystemDescription) {
    //Just return in the input type is null
    if (aLeoTypeSystemDescription == null) {
        return this;
    }

    //Append the types to the existing type system
    for (TypeDescription td : aLeoTypeSystemDescription.getTypes()) {
        this.addType(td);
    }//for

    return this;
}
 
开发者ID:department-of-veterans-affairs,项目名称:Leo,代码行数:20,代码来源:LeoTypeSystemDescription.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XMLStreamBufferSource类代码示例发布时间:2022-05-23
下一篇:
Java WSDLPart类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap