Examples of Feature


Examples of org.apache.shindig.gadgets.spec.Feature

    return getLockedDomainPrefix(gadget) + suffix;
  }

  private String getLockedDomainParticipants(Gadget gadget) throws GadgetException {
    Map<String, Feature> features = gadget.getSpec().getModulePrefs().getFeatures();
    Feature ldFeature = features.get("locked-domain");

    // This gadget is always a participant.
    Set<String> filtered = new TreeSet<String>();
    filtered.add(gadget.getSpec().getUrl().toString().toLowerCase());

    if (ldFeature != null) {
      Collection<String> participants = ldFeature.getParamCollection("participant");
      for (String participant : participants) {
        // be picky, this should be a valid uri
        try {
          Uri.parse(participant);
        } catch (UriException e) {
View Full Code Here

Examples of org.apache.sling.featureflags.Feature

    public Feature getFeature(final String name) {
        return this.activeFeatures.get(name);
    }

    public boolean isEnabled(String featureName) {
        final Feature feature = this.getFeature(featureName);
        if (feature != null) {
            return getCurrentExecutionContext().isEnabled(feature);
        }
        return false;
    }
View Full Code Here

Examples of org.apache.sling.provisioning.model.Feature

            throw new MojoExecutionException("Unable to cache model", ioe);
        }
    }

    public static org.apache.sling.provisioning.model.Artifact getBaseArtifact(final Model model) throws MojoExecutionException {
        final Feature base = model.getFeature(ModelConstants.FEATURE_LAUNCHPAD);
        if ( base == null ) {
            throw new MojoExecutionException("No launchpad feature found.");
        }
        // get global run mode
        final RunMode runMode = base.getRunMode(null);
        if ( runMode == null ) {
            throw new MojoExecutionException("No global run mode found in launchpad feature.");
        }
        if ( runMode.getArtifactGroups().isEmpty() ) {
            throw new MojoExecutionException("No base artifacts defined.");
View Full Code Here

Examples of org.apache.stanbol.commons.caslight.Feature

            FeatureStructure fs = new FeatureStructure(sourceName + "." + localName + "#" + elementCounter, type);
            for (int i = 0; i < attrs.getLength(); i++) {
                String name = attrs.getQName(i);
                String value = attrs.getValue(i);
                if (checkIfInteger(value)) {
                    Feature<Integer> f = new Feature(name, value);
                    fs.addFeature(f);
                } else {
                    Feature<String> f = new Feature(name, value);
                    fs.addFeature(f);
                }
            }
            fsList.add(fs);
View Full Code Here

Examples of org.apache.uima.annotator.regex.Feature

                     normalization = updateFeatures[x].getNormalization()
                           .intValue();
                  }
                  String implClass = updateFeatures[x].getClass1();
                  // create new feature and add them to the rule
                  Feature updateFeature = new Feature_impl(featureType,
                        featureName, featureValue, normalization, implClass);
                  rule.addUpdateFeature(updateFeature);
               }
            }

            // **********************************
            // get all exceptions for this rule
            // **********************************
            if (ruleList[r].getRuleExceptions() != null) {
               // iterate over all match type annotation update features and add
               // them to the rule
               ExceptionDocument.Exception[] exceptions = ruleList[r]
                     .getRuleExceptions().getExceptionArray();
               for (int x = 0; x < exceptions.length; x++) {
                  String exceptionMatchType = exceptions[x].getMatchType();
                  String regexPattern = exceptions[x].getStringValue();

                  // create new Exception object and add them to the rule
                  org.apache.uima.annotator.regex.RuleException exception = new RuleException_impl(
                        exceptionMatchType, regexPattern);
                  rule.addException(exception);
               }
            }

            // add rule to the concept
            concept.addRule(rule);
         }

         // **************************************
         // get all annotations for this concept
         // **************************************
         CreateAnnotationsDocument.CreateAnnotations annotations = concepts[i]
               .getCreateAnnotations();
         AnnotationDocument.Annotation[] annotationList = annotations
               .getAnnotationArray();
         for (int a = 0; a < annotationList.length; a++) {

            // create annotation position objects
            int beginMatchGroup = annotationList[a].getBegin().getGroup().intValue();
            int beginLocation = annotationList[a].getBegin().getLocation()
                  .intValue();
            int endMatchGroup = annotationList[a].getEnd().getGroup().intValue();
            int endLocation = annotationList[a].getEnd().getLocation()
                  .intValue();

            Position begin = new Position_impl(beginMatchGroup, beginLocation);
            Position end = new Position_impl(endMatchGroup, endLocation);

            // create annotation object
            String id = annotationList[a].getId();
            String type = annotationList[a].getType();
            String validationClass = annotationList[a].getValidate();

            Annotation annotation = new Annotation_impl(id, type, begin, end,
                  validationClass);

            // read out feature values and add it to the annotation
            SetFeatureDocument.SetFeature[] features = annotationList[a]
                  .getSetFeatureArray();
            for (int f = 0; f < features.length; f++) {
               String name = features[f].getName();
               int featureType = features[f].getType().intValue();
               String value = features[f].getStringValue();
               int normalization = 0;
               if (features[f].getNormalization() != null) {
                  normalization = features[f].getNormalization().intValue();
               }
               String implClass = features[f].getClass1();

               Feature feature = new Feature_impl(featureType, name, value,
                     normalization, implClass);
               annotation.addFeature(feature);
            }
            // add annotation to rule
            concept.addAnnotation(annotation);
View Full Code Here

Examples of org.apache.uima.cas.Feature

    xmlReader.parse(new InputSource(serCasStream));
    serCasStream.close();

    // check that array refs are not null
    Type entityType = cas.getTypeSystem().getType("org.apache.uima.testTypeSystem.Entity");
    Feature classesFeat = entityType.getFeatureByBaseName("classes");
    Iterator iter = cas.getIndexRepository().getIndex("testEntityIndex").iterator();
    assertTrue(iter.hasNext());
    while (iter.hasNext()) {
      FeatureStructure fs = (FeatureStructure) iter.next();
      StringArrayFS arrayFS = (StringArrayFS) fs.getFeatureValue(classesFeat);
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.servicediscovery.management.Feature

    }

    public List<InfoElement> getServerInfosFor(InfoRequest request) {
        List<InfoElement> infoElements = new ArrayList<InfoElement>();
        infoElements.add(new Identity("conference", "text", getName()));
        infoElements.add(new Feature(NamespaceURIs.XEP0045_MUC));
        return infoElements;
    }
View Full Code Here

Examples of org.apache.wookie.feature.Feature

   */
  @Test
  public void loadFeature() throws Exception{
    File featureFile = new File(testDataFolder+"feature.xml");
    assertTrue(featureFile.exists());
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals("test:feature", feature.getName());
    assertEquals(0, feature.stylesheets().length);
    assertEquals(0, feature.scripts().length);
  }
View Full Code Here

Examples of org.bioversityinternational.model.annotation.Feature

   * @throws ModelException
   */
  public static Feature descriptor(String descriptorName) {

    // TODO: just a stub
    Feature descriptor = new FeatureObject(
        null, // identifier of owner?
        null, // type
        null  // values
        ) ;
    return descriptor ;
View Full Code Here

Examples of org.cleartk.classifier.Feature

      for (BaseToken token : tokens) {
        ++outcomeIndex;

        // extract token features
        List<Feature> features = new ArrayList<Feature>();
        features.add(new Feature(token.getCoveredText()));
        features.add(new Feature("PartOfSpeech", token.getPartOfSpeech()));

        // extract previous classification features
        for (int i = this.nPreviousClassifications; i > 0; --i) {
          int index = outcomeIndex - i;
          String previousOutcome = index < 0 ? "O" : outcomes.get(index);
          features.add(new Feature("PreviousOutcome_" + i, previousOutcome));
        }

        // extract length of Modifier that is currently being created (if any)
        // int length = 0;
        // for (int i = outcomeIndex - 1; i > 0 && !"O".equals(outcomes.get(i)); --i) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.