예제 #1
0
  /** Called by {@link AbstractPOSTagger#processAux()}. */
  protected void addLexica() {
    DEPNode node;
    int i;

    for (i = 1; i < t_size; i++) {
      node = d_tree.get(i);

      if (s_lsfs.contains(node.lowerSimplifiedForm)) p_ambi.add(node.simplifiedForm, g_tags[i]);
    }
  }
예제 #2
0
  /** Called by {@link AbstractPOSTagger#getLexica()}. */
  private Map<String, String> getAmbiguityClasses() {
    double threshold = f_xmls[0].getAmbiguityClassThreshold();
    Map<String, String> mAmbi = new HashMap<String, String>();
    StringDoublePair[] ps;
    StringBuilder build;

    for (String key : p_ambi.keySet()) {
      build = new StringBuilder();
      ps = p_ambi.getProb1D(key);
      Arrays.sort(ps);

      for (StringDoublePair p : ps) {
        if (p.d <= threshold) break;

        build.append(AbstractColumnReader.BLANK_COLUMN);
        build.append(p.s);
      }

      if (build.length() > 0) mAmbi.put(key, build.substring(1));
    }

    return mAmbi;
  }