Exemplo n.º 1
0
 public void GetWordGraph_EmptySegment_ReturnsEmptyGraph()
 {
     using (var smtModel = new ThotSmtModel(TestHelpers.ToyCorpusConfigFileName))
         using (ISmtEngine engine = smtModel.CreateEngine())
         {
             WordGraph wordGraph = engine.GetWordGraph(new string[0]);
             Assert.That(wordGraph.IsEmpty, Is.True);
         }
 }
        public void Estimate(IReadOnlyList <string> sourceSegment, TranslationResultBuilder builder)
        {
            WordGraph            wordGraph            = _smtEngine.GetWordGraph(sourceSegment);
            WordGraphConfidences wordGraphConfidences = ComputeWordGraphConfidences(wordGraph);

            for (int j = 0; j < builder.Words.Count; j++)
            {
                builder.SetConfidence(j, wordGraphConfidences.GetConfidence(builder.Words[j]));
            }
        }