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); }
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); } }
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); }