Examples of WoodInterface


Examples of org.nlpcn.commons.lang.tire.domain.WoodInterface

  /**
   * Swaps x[a] with x[b].
   */
  private static void swap(WoodInterface[] x, int a, int b) {
    WoodInterface t = x[a];
    x[a] = x[b];
    x[b] = t;
  }
View Full Code Here

Examples of org.nlpcn.commons.lang.tire.domain.WoodInterface

    insertWord(forest, temp, resultParams);
  }

  private static void insertWord(WoodInterface forest, String temp, String[] param) {
    WoodInterface branch = forest;
    char[] chars = temp.toCharArray();
    for (int i = 0; i < chars.length; i++) {
      if (chars.length == i + 1) {
        branch.add(new Branch(chars[i], 3, param));
      } else {
        branch.add(new Branch(chars[i], 1, null));
      }
      branch = branch.get(chars[i]);
    }
  }
View Full Code Here

Examples of org.nlpcn.commons.lang.tire.domain.WoodInterface

   *
   * @param forest
   * @param temp
   */
  public static void removeWord(Forest forest, String word) {
    WoodInterface branch = forest;
    char[] chars = word.toCharArray();

    for (int i = 0; i < chars.length; i++) {
      if (branch == null)
        return;
      if (chars.length == i + 1) {
        branch.add(new Branch(chars[i], -1, null));
      }
      branch = branch.get(chars[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.