예제 #1
0
        public void TestDetectLanguage()
        {
            MetaTextClient client = new MetaTextClient(your_api_key, MetaTextClient.ENDPOINT);

            string text = "The quick brown fox.";
            string response = client.DetectLanguage(text);

            Console.WriteLine("Detected language: " + response);
        }
예제 #2
0
        public void TestEnrich()
        {
            string entityUri = "http://dbpedia.org/resource/Michael_Jordan";
            int maxEnrichments = 100;

            MetaTextClient client = new MetaTextClient(your_api_key, MetaTextClient.ENDPOINT);

            Dictionary<string, string> enrichments = client.Enrich(entityUri, maxEnrichments);

            foreach (KeyValuePair<string, string> entry in enrichments)
            {
                Console.WriteLine(entry.Key + " = " + entry.Value);
            }
        }
예제 #3
0
        public void TestDisambiguate()
        {
            string entity = "Michael Jordan";
            string text = "Michael Jordan was a basketball player for the Chicago Bulls.";
            string entityClass = "Person";

            MetaTextClient client = new MetaTextClient(your_api_key, MetaTextClient.ENDPOINT);

            string response = client.Disambiguate(entity, text, entityClass);

            Console.WriteLine("Disambiguated Entity URI: " + response);

            Assert.AreEqual("http://dbpedia.org/resource/Michael_Jordan", response);
        }