def _load_wordnet(self, evaluation, language_name): language_code = None if isinstance(language_name, String): language_code = iso639_3.get(language_name.get_string_value()) if not language_code: evaluation.message(self.get_name(), 'lang', language_name, strip_context(self.get_name())) return None, None wordnet = _WordNetBuiltin._wordnet_instances.get(language_code) if not wordnet: try: wordnet = self._init_wordnet(evaluation, language_name, language_code) except LookupError as e: evaluation.message(self.get_name(), 'package', _parse_nltk_lookup_error(e)) return None, None _WordNetBuiltin._wordnet_instances[language_code] = wordnet return wordnet, language_code
def _load_wordnet(self, evaluation, language_name): language_code = None if isinstance(language_name, String): language_code = iso639_3.get(language_name.get_string_value()) if not language_code: evaluation.message(self.get_name(), 'lang', language_name, strip_context(self.get_name())) return None, None wordnet = _WordNetBuiltin._wordnet_instances.get(language_code) if not wordnet: try: wordnet = self._init_wordnet(evaluation, language_name, language_code) except LookupError as e: evaluation.message(self.get_name(), 'package', _parse_nltk_lookup_error(e)) return None, None _WordNetBuiltin._wordnet_instances[language_code] = wordnet return wordnet, language_code