How to use the num2words.CONVERTER_CLASSES function in num2words

To help you get started, we’ve selected a few num2words examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github savoirfairelinux / num2words / tests / test_cli.py View on Github external
def test_cli_list_langs(self):
        """You should be able to list all availabe languages
        """
        output = self.cli.run_cmd('--list-languages')
        self.assertEqual(
            sorted(list(num2words.CONVERTER_CLASSES.keys())),
            output.out.strip().split(os.linesep)
        )
        output = self.cli.run_cmd('-L')
        self.assertEqual(
            sorted(list(num2words.CONVERTER_CLASSES.keys())),
            output.out.strip().split(os.linesep)
        )
github savoirfairelinux / num2words / tests / test_cli.py View on Github external
def test_cli_list_langs(self):
        """You should be able to list all availabe languages
        """
        output = self.cli.run_cmd('--list-languages')
        self.assertEqual(
            sorted(list(num2words.CONVERTER_CLASSES.keys())),
            output.out.strip().split(os.linesep)
        )
        output = self.cli.run_cmd('-L')
        self.assertEqual(
            sorted(list(num2words.CONVERTER_CLASSES.keys())),
            output.out.strip().split(os.linesep)
        )
github neotrons / currency2words / currency2words / Currency2Words.py View on Github external
def get_lang_object(self, lang):
        if lang not in CONVERTER_CLASSES:
            lang = lang[:2]
        if lang not in CONVERTER_CLASSES:
            raise NotImplementedError()
        return CONVERTER_CLASSES[lang]