Examples of PrefixTree


Examples of fr.univnantes.lina.uima.dataModels.PrefixTree

      int currentCodePoint = text.codePointAt(index);

      Map<PrefixTree,Branch> nextExploredBranches = new HashMap<PrefixTree,Branch>();
      //if (debug) System.out.println("Debug: for each currently explored branch");
      for (PrefixTree currentExploredBranch : currentExploredBranches.keySet()) {
        PrefixTree nextExploredBranch = currentExploredBranch.getChild(currentCodePoint);

        //
        Branch currentBranch = currentExploredBranches.get(currentExploredBranch);

        //
View Full Code Here

Examples of joshua.prefix_tree.PrefixTree

    BasicPhrase query = new BasicPhrase("it makes him", sourceVocab);
    //BasicPhrase query = new BasicPhrase("it makes him and it mars him", sourceVocab);
    //BasicPhrase query = new BasicPhrase("it makes him and it mars him , it sets him on and it takes him off .", sourceVocab);
    ParallelCorpusGrammarFactory parallelCorpus = new ParallelCorpusGrammarFactory(suffixArray, targetSuffixArray, alignments, null, sampleSize, maxPhraseSpan, maxPhraseLength, maxNonterminals, minNonterminalSpan, Float.MIN_VALUE, JoshuaConfiguration.phrase_owner, JoshuaConfiguration.default_non_terminal, JoshuaConfiguration.oovFeatureCost);
//    simplePrefixTree = new PrefixTree(suffixArray, targetCorpusArray, alignments, suffixArray.getVocabulary(), lexProbs, ruleExtractor, maxPhraseSpan, maxPhraseLength, maxNonterminals, minNonterminalSpan);
    simplePrefixTree = new PrefixTree(parallelCorpus);
    simplePrefixTree.add(query.getWordIDs());
   
    Assert.assertNotNull(simplePrefixTree.root);
    Assert.assertNotNull(simplePrefixTree.root.children);
   
View Full Code Here

Examples of joshua.prefix_tree.PrefixTree

    //BasicPhrase query = new BasicPhrase("it makes him", sourceVocab);
    //BasicPhrase query = new BasicPhrase("it makes him and it mars him", sourceVocab);
    BasicPhrase query = new BasicPhrase("it makes him and it mars him , it sets him on and it takes him off .", sourceVocab);
    ParallelCorpusGrammarFactory parallelCorpus = new ParallelCorpusGrammarFactory(suffixArray, targetSuffixArray, alignments, null, sampleSize, maxPhraseSpan, maxPhraseLength, maxNonterminals, minNonterminalSpan, Float.MIN_VALUE, JoshuaConfiguration.phrase_owner, JoshuaConfiguration.default_non_terminal, JoshuaConfiguration.oovFeatureCost);
//    PrefixTree prefixTree = new PrefixTree(suffixArray, targetCorpusArray, alignments, suffixArray.getVocabulary(), lexProbs, ruleExtractor, maxPhraseSpan, maxPhraseLength, maxNonterminals, minNonterminalSpan);
    PrefixTree prefixTree = new PrefixTree(parallelCorpus);
    prefixTree.add(query.getWordIDs());
     
    Assert.assertNotNull(prefixTree.root);
    Assert.assertNotNull(prefixTree.root.children);
   
    /////////////////////////////
View Full Code Here

Examples of joshua.prefix_tree.PrefixTree

    Assert.assertEquals(querySentence.toString(), "it UNK him and it UNK him");
    Assert.assertEquals(corpusSentence.toString(), corpusString);
    ParallelCorpusGrammarFactory parallelCorpus = new ParallelCorpusGrammarFactory(suffixArray, targetSuffixArray, alignments, null, sampleSize, maxPhraseSpan, maxPhraseLength, maxNonterminals, minNonterminalSpan, Float.MIN_VALUE, JoshuaConfiguration.phrase_owner, JoshuaConfiguration.default_non_terminal, JoshuaConfiguration.oovFeatureCost);

//    PrefixTree prefixTree = new PrefixTree(suffixArray, targetCorpusArray, alignments, suffixArray.getVocabulary(), lexProbs, ruleExtractor, maxPhraseSpan, maxPhraseLength, maxNonterminals, minNonterminalSpan);
    PrefixTree prefixTree = new PrefixTree(parallelCorpus);
    prefixTree.add(querySentence.getWordIDs());

   
   
    Assert.assertTrue(prefixTree.root.children.containsKey(PrefixTree.X));
    Assert.assertTrue(prefixTree.root.children.containsKey(sourceVocab.getID("it")));
View Full Code Here

Examples of joshua.prefix_tree.PrefixTree

    int[] words = new int[sentence.size()];
    for (int i = 0; i < words.length; i++) {
      words[i] = sentence.getWordID(i);
    }
   
    PrefixTree prefixTree = new PrefixTree(
//        sourceSuffixArray, targetCorpus, alignments,
//        sourceSuffixArray.getVocabulary(), lexProbs, ruleExtractor,
        this);
   
    prefixTree.add(words);
   
    return prefixTree;
//    return prefixTree.getRoot();
  }
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.