Package opennlp.model

Examples of opennlp.model.ComparablePredicate


        for (int pi=0;pi<numParams;pi++) {
          activeOutcomes[pi] = tmpOutcomes[pi];
          activeParams[pi] = tmpParams[pi];
        }
        if (numParams != 0) {
          tmpPreds[numPreds] = new ComparablePredicate(PRED_LABELS[pid],activeOutcomes,activeParams);
          numPreds++;
        }
      }
      System.err.println("Compressed "+PARAMS.length+" parameters to "+numPreds);
      sortPreds = new ComparablePredicate[numPreds];
View Full Code Here


      return sortPreds;
    }
   
       
    protected List<List<ComparablePredicate>> computeOutcomePatterns(ComparablePredicate[] sorted) {
      ComparablePredicate cp = sorted[0];
      List<List<ComparablePredicate>> outcomePatterns = new ArrayList<List<ComparablePredicate>>();
      List<ComparablePredicate> newGroup = new ArrayList<ComparablePredicate>();
      for (int i=0; i<sorted.length; i++) {
        if (cp.compareTo(sorted[i]) == 0) {
          newGroup.add(sorted[i]);
        }
        else {     
          cp = sorted[i];
          outcomePatterns.add(newGroup);
View Full Code Here

       *
       * int id = 0; for (int i=0; i < predkeys.length; i++) { int oid =
       * predkeys[i]; activeOutcomes[id] = oid; activeParams[id] =
       * PARAMS[pid].getParams(oid); id++; }
       */
      sortPreds[pid] = new ComparablePredicate(PRED_LABELS[pid],
          activeOutcomes, activeParams);
    }

    Arrays.sort(sortPreds);
    return sortPreds;
View Full Code Here

    Arrays.sort(sortPreds);
    return sortPreds;
  }

  protected List compressOutcomes(ComparablePredicate[] sorted) {
    ComparablePredicate cp = sorted[0];
    List outcomePatterns = new ArrayList();
    List newGroup = new ArrayList();
    for (int i = 0; i < sorted.length; i++) {
      if (cp.compareTo(sorted[i]) == 0) {
        newGroup.add(sorted[i]);
      } else {
        cp = sorted[i];
        outcomePatterns.add(newGroup);
        newGroup = new ArrayList();
View Full Code Here

       *
       * int id = 0; for (int i=0; i < predkeys.length; i++) { int oid =
       * predkeys[i]; activeOutcomes[id] = oid; activeParams[id] =
       * PARAMS[pid].getParams(oid); id++; }
       */
      sortPreds[pid] = new ComparablePredicate(PRED_LABELS[pid],
          activeOutcomes, activeParams);
    }

    Arrays.sort(sortPreds);
    return sortPreds;
View Full Code Here

    Arrays.sort(sortPreds);
    return sortPreds;
  }

  protected List<List<ComparablePredicate>> compressOutcomes(ComparablePredicate[] sorted) {
    ComparablePredicate cp = sorted[0];
    List<List<ComparablePredicate>> outcomePatterns = new ArrayList<List<ComparablePredicate>>();
    List<ComparablePredicate> newGroup = new ArrayList<ComparablePredicate>();
    for (int i = 0; i < sorted.length; i++) {
      if (cp.compareTo(sorted[i]) == 0) {
        newGroup.add(sorted[i]);
      } else {
        cp = sorted[i];
        outcomePatterns.add(newGroup);
        newGroup = new ArrayList<ComparablePredicate>();
View Full Code Here

        for (int pi=0;pi<numParams;pi++) {
          activeOutcomes[pi] = tmpOutcomes[pi];
          activeParams[pi] = tmpParams[pi];
        }
        if (numParams != 0) {
          tmpPreds[numPreds] = new ComparablePredicate(PRED_LABELS[pid],activeOutcomes,activeParams);
          numPreds++;
        }
      }
      System.err.println("Compressed "+PARAMS.length+" parameters to "+numPreds);
      sortPreds = new ComparablePredicate[numPreds];
View Full Code Here

      return sortPreds;
    }
   
       
    protected List<List<ComparablePredicate>> computeOutcomePatterns(ComparablePredicate[] sorted) {
      ComparablePredicate cp = sorted[0];
      List<List<ComparablePredicate>> outcomePatterns = new ArrayList<List<ComparablePredicate>>();
      List<ComparablePredicate> newGroup = new ArrayList<ComparablePredicate>();
      for (ComparablePredicate predicate : sorted) {
        if (cp.compareTo(predicate) == 0) {
          newGroup.add(predicate);
        } else {
          cp = predicate;
          outcomePatterns.add(newGroup);
          newGroup = new ArrayList<ComparablePredicate>();
View Full Code Here

TOP

Related Classes of opennlp.model.ComparablePredicate

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.