Exemplo n.º 1
0
        //Usage: SimilarityModel modelName < tiger/NN bear/NN
        public static string SimilarityMain(string modelName, string line)
        {
            SimilarityModel model = new SimilarityModel(modelName, false);
            //Context.wn = new WordNet(System.getProperty("WNHOME"), true);
            //Context.morphy = new Morphy(Context.wn);

            string[] words = line.Split(' ');
            double p = model.AreCompatible(Context.ParseContext(words[0]), Context.ParseContext(words[1]));
            return p + " " + string.Join(",", model.GetFeatures(Context.ParseContext(words[0]), Context.ParseContext(words[1])).ToArray());
        }
Exemplo n.º 2
0
        //Usage: SimilarityModel modelName < tiger/NN bear/NN
        public static string SimilarityMain(string modelName, string line)
        {
            var model = new SimilarityModel(modelName, false);
            //Context.wn = new WordNet(System.getProperty("WNHOME"), true);
            //Context.morphy = new Morphy(Context.wn);

            var words = line.Split(' ');
            var p     = model.AreCompatible(Context.ParseContext(words[0]), Context.ParseContext(words[1]));

            return(p + " " + string.Join(",", model.GetFeatures(Context.ParseContext(words[0]), Context.ParseContext(words[1])).ToArray()));
        }