当前位置: 首页>>代码示例>>C#>>正文


C# Word.GetSurface方法代码示例

本文整理汇总了C#中Word.GetSurface方法的典型用法代码示例。如果您正苦于以下问题:C# Word.GetSurface方法的具体用法?C# Word.GetSurface怎么用?C# Word.GetSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Word的用法示例。


在下文中一共展示了Word.GetSurface方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LerimdekilerdenTest

        public string LerimdekilerdenTest(string rootWord)
        {
            Root root = tr.GetRootsHavingSurface(rootWord).First();
            word = new Word(root);
            word.AddSuffix(tr.GetSuffix("IC_COGUL_lAr"));
            word.AddSuffix(tr.GetSuffix("IC_SAHIPLIK_BEN_(U)m"));
            word.AddSuffix(tr.GetSuffix("IC_HAL_BULUNMA_DA"));
            word.AddSuffix(tr.GetSuffix("IC_AITLIK_ki"));
            word.AddSuffix(tr.GetSuffix("IC_COGUL_lAr"));
            word.AddSuffix(tr.GetSuffix("IC_HAL_AYRILMA_DAn"));

            return word.GetSurface();
        }
开发者ID:drupaltr,项目名称:nuve,代码行数:13,代码来源:NounGenerationTest.cs

示例2: TestGeneration

        public string TestGeneration(string rootWord)
        {
            var root = Tr.GetRootsHavingSurface(rootWord).First();

            var word = new Word(root);
            word.AddSuffix(Tr.GetSuffix("IC_COGUL_lAr"));
            word.AddSuffix(Tr.GetSuffix("IC_SAHIPLIK_BEN_(U)m"));
            word.AddSuffix(Tr.GetSuffix("IC_HAL_BULUNMA_DA"));
            word.AddSuffix(Tr.GetSuffix("IC_AITLIK_ki"));
            word.AddSuffix(Tr.GetSuffix("IC_COGUL_lAr"));
            word.AddSuffix(Tr.GetSuffix("IC_HAL_AYRILMA_DAn"));

            return word.GetSurface();
        }
开发者ID:diegolinan,项目名称:nuve,代码行数:14,代码来源:NounGenerationTest.cs

示例3: TestCopyOf

        public void TestCopyOf()
        {
            var root = Tr.GetRootsHavingSurface("kitap").First();
            var word = new Word(root);
            word.AddSuffix(Tr.GetSuffix("IC_COGUL_lAr"));
            word.AddSuffix(Tr.GetSuffix("IC_SAHIPLIK_BEN_(U)m"));
            word.AddSuffix(Tr.GetSuffix("IC_HAL_BULUNMA_DA"));
            word.AddSuffix(Tr.GetSuffix("IC_AITLIK_ki"));
            word.AddSuffix(Tr.GetSuffix("IC_COGUL_lAr"));
            word.AddSuffix(Tr.GetSuffix("IC_HAL_AYRILMA_DAn"));

            var copy = Word.CopyOf(word);

            Assert.True(word.Equals(word));
            Assert.False(word.Equals(null));

            Assert.AreNotSame(word, copy);
            Assert.AreEqual(word.GetSurface(), copy.GetSurface());
            Assert.True(word.Equals(copy));
        }
开发者ID:diegolinan,项目名称:nuve,代码行数:20,代码来源:NounGenerationTest.cs

示例4: HasCorrectSurface

 private bool HasCorrectSurface(Word word, string surface)
 {
     return word.GetSurface() == surface;
 }
开发者ID:drupaltr,项目名称:nuve,代码行数:4,代码来源:WordAnalyzer.cs

示例5: Conjugate

        public string Conjugate(Root verbRoot, bool negative, bool question)
        {
            var copy = new Word(verb) {Root = verbRoot};
            if (negative)
            {
                copy.AddSuffixAfterRoot(Negative);
            }
            if (question)
            {
            }

            return copy.GetSurface();
        }
开发者ID:drupaltr,项目名称:nuve,代码行数:13,代码来源:Conjugation.cs

示例6: Main

        private static void Main()
        {
            //var lines = File.ReadAllLines(@"C:\Users\harun_000\Desktop\workspace\corpus\unigrams.txt",
            //    Encoding.UTF8);

            //List<string> resolved = new List<string>();
            //List<string> unresolved = new List<string>();

            //foreach (var line in lines)
            //{
            //    var token = line.Split(null)[0];
            //    var solutions = Analyzer.Analyze(token);
            //    if (solutions.Count == 0)
            //    {
            //        unresolved.Add(line);
            //    }
            //    else
            //    {
            //        resolved.Add(line);
            //    }
            //}

            //File.WriteAllLines(@"C:\Users\harun_000\Desktop\workspace\nuve_resolved", resolved, Encoding.UTF8);
            //File.WriteAllLines(@"C:\Users\harun_000\Desktop\workspace\nuve_unresolved", unresolved, Encoding.UTF8);

            //var nuve_resolved = File.ReadAllLines(@"C:\Users\harun_000\Desktop\workspace\nuve_resolved", Encoding.UTF8);
            //var zemberek_resolved = File.ReadAllLines(@"C:\Users\harun_000\Desktop\workspace\zemberek_resolved",
            //    Encoding.UTF8);

            //var onlyZemberek = zemberek_resolved.Except(nuve_resolved);
            //var onlyNuve = nuve_resolved.Except(zemberek_resolved);

            //File.WriteAllLines(@"C:\Users\harun_000\Desktop\workspace\onlyZemberek", onlyZemberek, Encoding.UTF8);
            //File.WriteAllLines(@"C:\Users\harun_000\Desktop\workspace\onlyNuve", onlyNuve, Encoding.UTF8);

            //File.WriteAllText(@"C:\Users\harun_000\Desktop\vboxshare\tokenized-paragraphs-with-punctuation.txt", Split(text), Encoding.UTF8);

            //File.WriteAllLines(@"C:\Users\harun_000\Desktop\vboxshare\sentences-no-punctuation-remove-empty-lines.txt", paragraphs.Select(p => Regex.Replace(p, "[^\\p{L}\\p{Nd}' ]", "")), Encoding.UTF8);

            //Benchmarker.TestWithAMillionWords(Analyzer);
            //Benchmarker.TestWithAMillionTokens(Analyzer);

            //Language tr = Language.Turkish;

            ////Analysis
            //var analyzer = new WordAnalyzer(tr);

            ////Morphologic Analysis and stemming
            //IList<Word> solutions = analyzer.Analyze("deneme");

            //foreach (var solution in solutions)
            //{
            //    Console.WriteLine("\t{0}", solution);
            //    Console.WriteLine("\toriginal:{0} stem:{1}\n",
            //    solution.GetSurface(),
            //    solution.GetStem().GetSurface()); //Stemming
            //}

            var tr = Language.Turkish;
            var root = tr.GetRootsHavingSurface("gel").First();
            Word word = new Word(root);

            if(!word.AddSuffix(tr.GetSuffix("IC_COGUL_lAr"), tr))
            {
                Console.WriteLine("Adding the suffix IC_COGUL_lAr after a verb is not valid!");
                Console.WriteLine(word.GetSurface()); //prints just gel "gel"
            }

            Console.WriteLine(root);
            Console.WriteLine(word);
            Console.WriteLine(word.GetSurface());

            Test();
        }
开发者ID:diegolinan,项目名称:nuve,代码行数:74,代码来源:Program.cs


注:本文中的Word.GetSurface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。