Exemple #1
0
        public void GetSuggestion_PrefixPartialWord_NoSuggestions()
        {
            TranslationResult result = CreateResult(5, 1, "te this is a test .", -1, 0.5, 0.5, 0.5, 0.5, 0.5);
            var suggester            = new WordTranslationSuggester()
            {
                ConfidenceThreshold = 0.2
            };

            Assert.That(suggester.GetSuggestion(1, false, result).TargetWordIndices, Is.Empty);
        }
Exemple #2
0
        public void GetSuggestion_DeletedWord_IgnoresDeletedWord()
        {
            TranslationResult result = CreateResult(6, 0, "this is a test .", -1, 0.5, 0.5, 0.5, 0.5, 0.5);
            var suggester            = new WordTranslationSuggester()
            {
                ConfidenceThreshold = 0.2
            };

            Assert.That(suggester.GetSuggestion(0, true, result).TargetWordIndices, Is.EqualTo(new[] { 0, 1, 2, 3 }));
        }
Exemple #3
0
        public void GetSuggestion_PrefixCompletedWord_IncludesCompletedWord()
        {
            TranslationResult result = CreateResult(5, 1, "this is a test .", 0.5, 0.5, 0.5, 0.5, 0.5);
            var suggester            = new WordTranslationSuggester()
            {
                ConfidenceThreshold = 0.2
            };

            Assert.That(suggester.GetSuggestion(1, false, result).TargetWordIndices, Is.EqualTo(new[] { 0, 1, 2, 3 }));
        }