Examples of DoubleContainer


Examples of edu.stanford.nlp.sempre.fbalignment.utils.DoubleContainer

    Map<Context,DoubleContainer> context1Rules = rulesMap.get(context1);
    if(context1Rules==null) {
      context1Rules = new HashMap<Context, DoubleContainer>();
      rulesMap.put(context1, context1Rules);
    }
    DoubleContainer count = context1Rules.get(context2);
    if(count==null) {
      count = new DoubleContainer(0.0);
      context1Rules.put(context2, count);
    }
    count.set(count.value()+1);
  }
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.utils.DoubleContainer

    return new Interval(start, end);
  }

  public DoubleContainer match(Context questionContext, Context candidate) {
    if(rulesMap.containsKey(questionContext)){
      return MapUtils.get(rulesMap.get(questionContext),candidate,new DoubleContainer(0.0));
    }
    return new DoubleContainer(0.0);
  }
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.utils.DoubleContainer

      throw new RuntimeException("Can not increment a normalized context mapper");

    MapUtils.putIfAbsent(contextToBinaryCounter, c, new HashMap<Formula,DoubleContainer>());
    Map<Formula,DoubleContainer> formulaMap = contextToBinaryCounter.get(c); //guaranteed to exist

    MapUtils.putIfAbsent(formulaMap, f, new DoubleContainer(0.0));
    DoubleContainer currValue = formulaMap.get(f);
    currValue.inc(value);

  }
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.utils.DoubleContainer

    for(Context candidate: candidates) {
      if(candidate.equals(questionContext)) {
        LogInfo.logs("RuleTransformationModel: Exact match",questionContext,candidate);
        res.clear();
        res.put(candidate, new DoubleContainer(1.0));
        break;
      }
      double matchCount = rules.match(questionContext,candidate).value();
      if(matchCount>0.0) {
        LogInfo.logs("RuleTransformationModel: question=%s, match=%s, score=%s",questionContext,candidate,matchCount);
        res.put(candidate, new DoubleContainer(matchCount));
      }
    }
    MathUtils.normalizeDoubleMap(res);
    return CollectionUtils.doubleContainerToDoubleMap(res);
  }
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.utils.DoubleContainer

    //construct formula map   
    for (Derivation deriv : predDerivations) {
      if (aggregationMap.containsKey(deriv.formula))
        aggregationMap.get(deriv.formula).getSecond().inc(deriv.prob);
      else
        aggregationMap.put(deriv.formula, Pair.newPair(Pair.newPair(deriv.formula, deriv.value), new DoubleContainer(deriv.prob)));
    }

    List<Pair<Pair<Formula, Value>, DoubleContainer>> formulaList = new ArrayList<Pair<Pair<Formula, Value>, DoubleContainer>>(aggregationMap.values());
    double sum = 0.0;
    for (Pair<Pair<Formula, Value>, DoubleContainer> pair : formulaList)
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.utils.DoubleContainer

    for (Derivation deriv : predDerivations) {
      String strValue = deriv.value != null ? deriv.value.toString() : "-UNKNOWN-";
      if (aggregationMap.containsKey(strValue))
        aggregationMap.get(strValue).getSecond().inc(deriv.prob);
      else
        aggregationMap.put(strValue, new Pair<Value, DoubleContainer>(deriv.value, new DoubleContainer(deriv.prob)));
    }
    List<Pair<Value, DoubleContainer>> valueList = new ArrayList<Pair<Value, DoubleContainer>>(aggregationMap.values());
    double sum = 0.0;
    for (Pair<Value, DoubleContainer> pair : valueList)
      sum += pair.getSecond().value();
View Full Code Here

Examples of org.jboss.serial.finalcontainers.DoubleContainer

         */
        public void writeDouble(double v) throws IOException
        {
            //flush();
            //DataContainer.this.content.add(Double.valueOf(v));
            DataContainer.this.content.add(new DoubleContainer(v));
        }
View Full Code Here

Examples of org.jboss.serial.finalcontainers.DoubleContainer

                case FLOAT:
                    content.add(new FloatContainer(input.readFloat()));break;
                case FLOATOBJ:
                    content.add(new Float(input.readFloat()));break;
                case DOUBLE:
                    content.add(new DoubleContainer(input.readDouble()));break;
                case DOUBLEOBJ:
                    content.add(new Double(input.readDouble()));break;
                case CHARACTER:
                    content.add(new CharacterContainer(input.readChar()));break;
                case CHARACTEROBJ:
View Full Code Here

Examples of org.jboss.serial.finalcontainers.DoubleContainer

                case FLOAT:
                    content.add(new FloatContainer(input.readFloat()));break;
                case FLOATOBJ:
                    content.add(new Float(input.readFloat()));break;
                case DOUBLE:
                    content.add(new DoubleContainer(input.readDouble()));break;
                case DOUBLEOBJ:
                    content.add(new Double(input.readDouble()));break;
                case CHARACTER:
                    content.add(new CharacterContainer(input.readChar()));break;
                case CHARACTEROBJ:
View Full Code Here

Examples of org.jboss.serial.finalcontainers.DoubleContainer

         */
        public void writeDouble(double v) throws IOException
        {
            //flush();
            //DataContainer.this.content.add(Double.valueOf(v));
            DataContainer.this.content.add(new DoubleContainer(v));
        }
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.