Package org.apache.vinci.transport

Examples of org.apache.vinci.transport.KeyValuePair


    VinciFrame service = in.fgetVinciFrame("SERVICE");

    Hashtable H = new Hashtable();

    int total = service.getKeyValuePairCount();
    KeyValuePair P = null;
    for (int i = 0; i < total; i++) {
      P = service.getKeyValuePair(i);

      if (P.isValueALeaf()) {
        H.put(P.getKey(), P.getValueAsString());
      } else {
        H.put(P.getKey(), P.getValue());
      }
    }

    String level = (String) H.get("LEVEL");
    if (strip(level) == null)
View Full Code Here


    VinciFrame service = in.fgetVinciFrame("SERVICE");

    Hashtable H = new Hashtable();

    int total = service.getKeyValuePairCount();
    KeyValuePair P;
    for (int i = 0; i < total; i++) {
      P = service.getKeyValuePair(i);
      if (P.isValueALeaf()) {
        H.put(P.getKey(), P.getValueAsString());
      } else {
        H.put(P.getKey(), P.getValue());
      }
    }

    boolean ok = false;
View Full Code Here

  public static CasData addKeysToDataCas(CasData dataCas, AFrame aFrame) throws Exception {
    try {
      aFrame = aFrame.fgetAFrame(Constants.KEYS);
      int frameCount = aFrame.getKeyValuePairCount();
      for (int i = 0; i < frameCount; i++) {
        KeyValuePair kvp = aFrame.getKeyValuePair(i);
        String featureStructureType = kvp.getKey();
        // Convert WF keys from ':' representation to '_colon_'
        if (featureStructureType
                .indexOf(org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM) > -1) {
          featureStructureType = StringUtils.replaceAll(featureStructureType,
                  org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM,
                  org.apache.uima.collection.impl.cpm.Constants.LONG_COLON_TERM);
        }
        // Convert WF keys from '-' representation to '_dash_'
        if (featureStructureType
                .indexOf(org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM) > -1) {
          featureStructureType = StringUtils.replaceAll(featureStructureType,
                  org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM,
                  org.apache.uima.collection.impl.cpm.Constants.LONG_DASH_TERM);
        }

        FeatureStructure vfs = new FeatureStructureImpl();
        vfs.setType(featureStructureType);

        FrameLeaf leafFrame = kvp.getValueAsLeaf();

        PrimitiveValue pv = new PrimitiveValueImpl(leafFrame.toString());
        vfs.setFeatureValue(featureStructureType, pv);
        dataCas.addFeatureStructure(vfs);
      }
View Full Code Here

TOP

Related Classes of org.apache.vinci.transport.KeyValuePair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.