get_translation: Get translations of individual words from nltk

View source: R/get_translations.R

get_translationR Documentation

Get translations of individual words from nltk

Description

This will match up to 4 meanings where the requested word and part of speech match. The first 2 results from each meaning-set are returned, then the first four unique translations are selected. This means there is a fairly strong tendency towards the most common two or three synsets. For more information on synsets, see the Open Multilingual Wordnet documentation.

Usage

get_translation(token, part_of_speech, language = "jpn")

Arguments

token

an English word to pass to nltk's synset search

part_of_speech

one of "v" -verb, "a" - adjective, "n" - noun, or "r" - adverb

language

check the list of options with wordlists::ntlk_languages. Defaults to japanese

Value

a character vector of length one


antdurrant/word.lists documentation built on July 20, 2023, 3:57 p.m.