Package edu.umd.hooka

Examples of edu.umd.hooka.Int2FloatMap


    int fw[] = pp.getF().getWords();
    width = fw.length;
    // add null word to the beginning of e sentence:
    tcmap = new FloatWritable[(ew.length+1) * fw.length];
    int c = 0;
    Int2FloatMap ecm = null;
    if (_includeEnglishNullWord) {
      ecm = counts.get(nullWord);
      if (ecm == null) {
        ecm = new Int2FloatMap();
        counts.put(nullWord, ecm);
      }
      for (int fi:fw) {
        ecm.createIfMissing(fi);
        tcmap[c] = ecm.getFloatWritable(fi);
        c++;
      }
    } else { c += fw.length; }
    for (int ei:ew) {
      IntWritable cew = new IntWritable(ei);
      ecm = counts.get(cew);
      if (ecm == null) {
        ecm = new Int2FloatMap();
        counts.put(cew, ecm);
      }
      for (int fi:fw) {
        ecm.createIfMissing(fi);
        tcmap[c] = ecm.getFloatWritable(fi);
        c++;
      }
    }
  }
View Full Code Here

TOP

Related Classes of edu.umd.hooka.Int2FloatMap

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.