def test_should_load_resources_from_package(self):
        # When
        resources = load_resources("snips_nlu_en")

        # Then
        self.assertGreater(len(get_stems(resources)), 0)
Ejemplo n.º 2
0
 def setUp(self):
     for l in get_all_languages():
         load_resources(l)
    def test_should_load_resources_from_data_path(self):
        # When
        resources = load_resources("en")

        # Then
        self.assertGreater(len(get_stems(resources)), 0)
Ejemplo n.º 4
0
 def __init__(self, methodName='runTest'):
     super(SnipsTest, self).__init__(methodName)
     for l in get_all_languages():
         load_resources(l)
Ejemplo n.º 5
0
 def load_resources_if_needed(self, language):
     if self.resources is None or self.fitted:
         required_resources = None
         if self.config is not None:
             required_resources = self.config.get_required_resources()
         self.resources = load_resources(language, required_resources)
Ejemplo n.º 6
0
 def __init__(self, methodName='runTest'):
     super(SnipsTest, self).__init__(methodName)
     for l in get_all_languages():
         load_resources(l)
Ejemplo n.º 7
0
 def get_resources(cls, language):
     if language not in cls._resources:
         cls._resources[language] = load_resources(language)
     return cls._resources[language]