static void Main(string[] args) { using var httpClient = new HttpClient(); httpClient.Timeout = TimeSpan.FromSeconds(5); var dictionaryApi = new DictionaryApi(httpClient); var wordRequest = new DictionaryRequest { LanguageCode = args[0], Word = args[1] }; var wordResponse = dictionaryApi.GetWord(wordRequest); if (!wordResponse.Found) { C.WriteLine("The word/dictionary does not exist in this dictionary"); return; } C.WriteLine(wordResponse.Word.WordName); foreach (var meaning in wordResponse.Word.Meanings) { C.WriteLine($"- Meaning's part of speech: {meaning.PartOfSpeech}"); foreach (var definition in meaning.Type) { C.WriteLine($"-- Definition: {definition.Definition}"); C.WriteLine($"-- Example: {definition.Example}"); } } }
public async Task ResultNotEmptyTest(string word, string language, bool fallback) { // Act var results = await DictionaryApi.GetDefinitionsAsync(word, language, fallback); // Assert Assert.NotEmpty(results); }
static ApiRouter() { Projects = new ProjectsApi(); ProjectFolders = new ProjectFoldersApi(); ProjectGroups = new ProjectGroupsApi(); ProjectTypes = new ProjectTypesApi(); Participants = new ParticipantsApi(); Dictionary = new DictionaryApi(); Casebook = new CasebookApi(); ProjectCustomValues = new ProjectCustomValuesApi(); CalculationFormulas = new CalculationFormulasApi(); Responsibles = new ResponsiblesApi(); Currencies = new CurrenciesApi(); }
public Synonymizer(IKeywordExtractor extractor, DictionaryApi api) : this(extractor) { Api = api; }
public Synonymizer(IKeywordExtractor extractor) { KeywordExtractor = extractor; Api = new DictionaryApi(); }