Example #1
0
 def _get_commands(self):  # type: (Analyzer) -> List[List[str]]
     """
     Returns:
         List[List[str]]
     """
     if self.lang not in self.analyzer_cmds:
         mode_path, mode = apertium.analyzers[self.lang]
         self.analyzer_cmds[self.lang] = parse_mode_file(mode_path+'/modes/'+mode+'.mode')
     return self.analyzer_cmds[self.lang]
Example #2
0
    def _get_commands(self) -> List[List[str]]:
        """
        Returns:
            List[List[str]]
        """
        if self.lang not in self.analyzer_cmds:
            mode_path, mode = apertium.analyzers[self.lang]
            abs_mode_path = os.path.join(mode_path, 'modes', '{}.mode'.format(mode))
            self.analyzer_cmds[self.lang] = parse_mode_file(abs_mode_path)

        return self.analyzer_cmds[self.lang]
Example #3
0
 def _get_commands(self) -> List[List[str]]:
     """
     Returns:
         List[List[str]]
     """
     if self.lang not in self.generator_cmds:
         mode_path, mode = apertium.generators[self.lang]
         self.generator_cmds[self.lang] = parse_mode_file(mode_path +
                                                          '/modes/' + mode +
                                                          '.mode')
     return self.generator_cmds[self.lang]
Example #4
0
    def _get_commands(self, l1: str, l2: str) -> List[List[str]]:
        """
        Args:
            l1 (str)
            l2 (str)

        Returns:
            List[List[str]]
        """
        if (l1, l2) not in self.translation_cmds:
            mode_path = apertium.pairs['%s-%s' % (l1, l2)]
            self.translation_cmds[(l1, l2)] = parse_mode_file(mode_path)
        return self.translation_cmds[(l1, l2)]