Examples of Trie


Examples of CtCILibrary.Trie

    if (groupList[length - 1] == null || groupList[height - 1] == null) {
      return null;
    }
    if (trieList[height - 1] == null) {
      ArrayList<String> words = groupList[height - 1].getWords();
      trieList[height - 1] = new Trie(words);
    }
    return makePartialRectangle(length, height, new Rectangle(length));
  }
View Full Code Here

Examples of com.atilika.kuromoji.trie.Trie

import java.util.Set;

public class DoubleArrayTrieBuilder {

  public static DoubleArrayTrie build(Set<Entry<Integer, String>> entries, boolean compactTries) {
    Trie tempTrie = buildTrie(entries);
    DoubleArrayTrie daTrie = new DoubleArrayTrie(compactTries);
    daTrie.build(tempTrie);
    return daTrie;
  }
View Full Code Here

Examples of com.atilika.kuromoji.trie.Trie

    daTrie.build(tempTrie);
    return daTrie;
  }
 
  public static Trie buildTrie(Set<Entry<Integer, String>> entries) {
    Trie trie = new Trie();
    for (Entry<Integer, String> entry : entries) {
      String surfaceForm = entry.getValue();
      trie.add(surfaceForm);
    }
    return trie;
  }
View Full Code Here

Examples of joshua.decoder.ff.tm.Trie

              "DotChart.expand_cell(" + i + "," + j + "): "
              + "Null tnode for DotItem");
           
          } else {
            // match the terminal
            Trie child_tnode = dt.trieNode.matchOne(last_word);
            if (null != child_tnode) {
              // we do not have an ant for the terminal
              addDotItem(child_tnode, i, j - 1 + arc_len, dt.antSuperNodes, null, dt.srcPath.extend(arc));
            }
          }
View Full Code Here

Examples of joshua.decoder.ff.tm.Trie

   
    // dotitem in dot_bins[i][k]: looking for an item in the right to the dot
    for (DotNode dt : dotbins[i][k].dotNodes) {
      // see if it matches what the dotitem is looking for
      for (SuperNode s_t : t_ArrayList) {
        Trie child_tnode = dt.trieNode.matchOne(s_t.lhs);
        if (null != child_tnode) {
          if (true == startDotItems && !child_tnode.hasExtensions()) {
            continue; //TODO
          }
          addDotItem(child_tnode, i, j, dt.getAntSuperNodes(), s_t, dt.getSourcePath().extendNonTerminal());
        }
      }
View Full Code Here

Examples of joshua.decoder.ff.tm.Trie

      HGNode node = queue.remove(0);
      for(Grammar gr : grs){
        if (! gr.hasRuleForSpan(i, j, foreignSentenceLength))
          continue;
       
        Trie childNode = gr.getTrieRoot().matchOne(node.lhs); // match rule and complete part
        if (childNode != null
          && childNode.getRules() != null
          && childNode.getRules().getArity() == 1) { // have unary rules under this trienode
         
          ArrayList<HGNode> antecedents = new ArrayList<HGNode>();
          antecedents.add(node);
          List<Rule> rules = childNode.getRules().getSortedRules();
         
          for (Rule rule : rules) { // for each unary rules               
            ComputeNodeResult states = new ComputeNodeResult(this.featureFunctions, rule, antecedents, i, j, new SourcePath(), stateComputers, this.segmentID);
            HGNode resNode = chartBin.addHyperEdgeInCell(states, rule, i, j, antecedents, new SourcePath(), true);
            if (null != resNode) {
View Full Code Here

Examples of joshua.decoder.ff.tm.Trie

                    = new ArrayList<HGNode>(chartCell.getSortedNodes());


            while (queue.size() > 0) {
              HGNode item = (HGNode)queue.remove(0);
                Trie child_tnode = gr.getTrieRoot().matchOne(item.lhs);//match rule and complete part
                if (child_tnode != null
                && child_tnode.getRules() != null
                && child_tnode.getRules().getArity() == 1) {//have unary rules under this trienode
                        ArrayList<HGNode> l_ants = new ArrayList<HGNode>();
                        l_ants.add(item);
                        List<Rule> rules =
                                child_tnode.getRules().getSortedRules();

                        for (Rule rule : rules){//for each unary rules
                          ComputeNodeResult states = new ComputeNodeResult(this.featureFunctions, rule, l_ants, i, j, new SourcePath(), stateComputers, this.segmentID);
                            HGNode res_item = chartCell.addHyperEdgeInCell(states, rule, i, j, l_ants, new SourcePath(), false);
                            if (null != res_item) {
View Full Code Here

Examples of joshua.decoder.ff.tm.Trie

  /** Logger for this class. */
  //private static final Logger logger = Logger.getLogger(AbstractGrammar.class.getName());

  public void deriveConfusionFromGrammar(Grammar gr) {
    Trie root = gr.getTrieRoot();
    if(root!=null){
      deriveConfusionFromTrieNode(root);
    }
  }
View Full Code Here

Examples of org.ethereum.trie.Trie

  private Genesis() {
    super(PARENT_HASH, UNCLES_HASH, COINBASE, LOG_BLOOM, DIFFICULTY,
        NUMBER, MIN_GAS_PRICE, GAS_LIMIT, GAS_USED, TIMESTAMP,
        EXTRA_DATA, NONCE, null, null);
   
    Trie state = new TrieImpl(null);
        // The proof-of-concept series include a development pre-mine, making the state root hash
        // some value stateRoot. The latest documentation should be consulted for the value of the state root.
    for (String address : premine) {
      AccountState acctState = new AccountState(BigInteger.ZERO, PREMINE_AMOUNT);
      state.update(Hex.decode(address), acctState.getEncoded());
        }

    setStateRoot(state.getRootHash());
    }
View Full Code Here

Examples of org.ethereum.trie.Trie

    private static final Logger logger = LoggerFactory.getLogger("test");


    @Test
    public void testGenesisAccounts() {
        Trie trie = generateGenesisState();
        assertEquals(GENESIS_STATE_ROOT, Hex.toHexString(trie.getRootHash()));
    }
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.