Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #165 from WorksApplications/feature/kazuma-t/fix-u…
Browse files Browse the repository at this point in the history
…ser-pos

Fix a bug causing user-defined POS IDs change
  • Loading branch information
kazuma-t authored Sep 25, 2021
2 parents d4699a3 + 45c727d commit 03d9ff8
Show file tree
Hide file tree
Showing 5 changed files with 2,122 additions and 2 deletions.
1 change: 1 addition & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if !(type sudachipy > /dev/null 2>&1); then
fi
sudachipy build -o tests/resources/system.dic -d "the system dictionary for the unit tests" -m tests/resources/dict/matrix.def tests/resources/dict/lex.csv
sudachipy ubuild -o tests/resources/user.dic -s tests/resources/system.dic tests/resources/dict/user.csv
sudachipy ubuild -o tests/resources/large_user.dic -s tests/resources/system.dic tests/resources/dict/large_user.csv

set +e

Expand Down
2 changes: 0 additions & 2 deletions sudachipy/dictionarylib/wordinfolist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import struct
from functools import lru_cache

from .wordinfo import WordInfo

Expand All @@ -25,7 +24,6 @@ def __init__(self, bytes_, offset, word_size, has_synonym_gid):
self._word_size = word_size
self.has_synonym_gid = has_synonym_gid

@lru_cache(2048)
def get_word_info(self, word_id):
orig_pos = self.bytes.tell()
index = self.word_id_to_offset(word_id)
Expand Down
Loading

0 comments on commit 03d9ff8

Please sign in to comment.