Examples of TSTNode


Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

    File data = new File(storeDir, FILENAME);
    if (!data.exists() || !data.canRead()) {
      return false;
    }
    DataInputStream in = new DataInputStream(new FileInputStream(data));
    TSTNode root = trie.new TSTNode('\0', null);
    try {
      readRecursively(in, root);
      trie.setRoot(root);
    } finally {
      in.close();
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

    byte mask = in.readByte();
    if ((mask & HAS_VALUE) != 0) {
      node.data = new Float(in.readFloat());
    }
    if ((mask & LO_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.LOKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & EQ_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.EQKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & HI_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.HIKID] = kid;
      readRecursively(in, kid);
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

  @Override
  public boolean store(File storeDir) throws IOException {
    if (!storeDir.exists() || !storeDir.isDirectory() || !storeDir.canWrite()) {
      return false;
    }
    TSTNode root = trie.getRoot();
    if (root == null) { // empty tree
      return false;
    }
    File data = new File(storeDir, FILENAME);
    DataOutputStream out = new DataOutputStream(new FileOutputStream(data));
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

    byte mask = in.readByte();
    if ((mask & HAS_VALUE) != 0) {
      node.data = Long.valueOf(in.readLong());
    }
    if ((mask & LO_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.LOKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & EQ_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.EQKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & HI_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.HIKID] = kid;
      readRecursively(in, kid);
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

    writeRecursively(out, node.relatives[TSTNode.HIKID]);
  }

  @Override
  public boolean store(OutputStream output) throws IOException {
    TSTNode root = trie.getRoot();
    if (root == null) { // empty tree
      return false;
    }
    DataOutputStream out = new DataOutputStream(output);
    try {
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

  }

  @Override
  public boolean load(InputStream input) throws IOException {
    DataInputStream in = new DataInputStream(input);
    TSTNode root = trie.new TSTNode('\0', null);
    try {
      readRecursively(in, root);
      trie.setRoot(root);
    } finally {
      IOUtils.close(in);
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

    byte mask = in.readByte();
    if ((mask & HAS_VALUE) != 0) {
      node.data = Long.valueOf(in.readLong());
    }
    if ((mask & LO_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.LOKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & EQ_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.EQKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & HI_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.HIKID] = kid;
      readRecursively(in, kid);
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

  }

  @Override
  public boolean store(DataOutput output) throws IOException {
    output.writeVLong(count);
    TSTNode root = trie.getRoot();
    if (root == null) { // empty tree
      return false;
    }
    writeRecursively(output, root);
    return true;
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

  }

  @Override
  public boolean load(DataInput input) throws IOException {
    count = input.readVLong();
    TSTNode root = trie.new TSTNode('\0', null);
    readRecursively(input, root);
    trie.setRoot(root);
    return true;
  }
View Full Code Here

Examples of org.apache.lucene.search.suggest.jaspell.JaspellTernarySearchTrie.TSTNode

    byte mask = in.readByte();
    if ((mask & HAS_VALUE) != 0) {
      node.data = Long.valueOf(in.readLong());
    }
    if ((mask & LO_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.LOKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & EQ_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.EQKID] = kid;
      readRecursively(in, kid);
    }
    if ((mask & HI_KID) != 0) {
      TSTNode kid = trie.new TSTNode('\0', node);
      node.relatives[TSTNode.HIKID] = kid;
      readRecursively(in, kid);
    }
  }
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.