コード例 #1
0
ファイル: test_engine.py プロジェクト: Narga/ibus-ringo
    def setup(self):
        config = {
            "input-method": "telex",
            "output-charset": "utf-8",
            "skip-non-vietnamese": True,
            "auto-capitalize-abbreviations": False,
            "input-method-definition": {
                "a": "a^",
                "o": "o^",
                "e": "e^",
                "w": ["u*", "o*", "a+", "<ư"],
                "d": "d-",
                "f": "\\",
                "s": "/",
                "r": "?",
                "x": "~",
                "j": ".",
                "]": "<ư",
                "[": "<ơ",
                "}": "<Ư",
                "{": "<Ơ"
            },
        }

        self.eng = BaseBackend(
            config=config,
            abbr_expander=AbbreviationExpander(config),
            auto_corrector=None)
コード例 #2
0
    def setup(self):
        self.expander = Mock()
        self.corrector = Mock()
        self.config = {
            "enable-text-expansion": False,
            "skip-non-vietnamese": True
        }

        self.backend = BaseBackend(config=self.config,
                                   abbr_expander=self.expander,
                                   auto_corrector=self.corrector)