Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiuchiの解析速度が遅い #2

Open
sonoisa opened this issue Nov 20, 2019 · 0 comments
Open

Hiuchiの解析速度が遅い #2

sonoisa opened this issue Nov 20, 2019 · 0 comments
Labels
invalid This doesn't seem right

Comments

@sonoisa
Copy link
Owner

sonoisa commented Nov 20, 2019

次のコードにおいて、O(形態素 x 慣用句辞書のエントリ数)のマッチング処理が行われており、非効率的である。辞書の構造を枝刈りができるような形式にするなど、効率化を図りたい。

    def _get_candicate(self, morphs):
        candicate = []
        for morph in morphs:
            for idiom in self.idioms.dict:
                if self._is_match_pattern(morph, idiom.patterns[-1]):
                    candicate.append(idiom)
        return distinct(candicate)
@sonoisa sonoisa added the invalid This doesn't seem right label Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant