Skip to content

Commit

Permalink
moved iso positions directly into class
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislit committed Feb 27, 2020
1 parent 18de740 commit 9832941
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ Abydos
:target: #
:alt: pydocstyle Errors

.. |sloccount| image:: https://img.shields.io/badge/SLOCCount-40,528-blue.svg
.. |sloccount| image:: https://img.shields.io/badge/SLOCCount-40,604-blue.svg
:target: #
:alt: SLOCCount

.. |mypy| image:: https://img.shields.io/badge/mypy-1.89%25%20imprecise-1F5082.svg
.. |mypy| image:: https://img.shields.io/badge/mypy-1.88%25%20imprecise-1F5082.svg
:target: #
:alt: mypy Imprecision

Expand Down
88 changes: 82 additions & 6 deletions abydos/distance/_typo_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,88 @@ class TypoAdvanced(_Distance):
.. versionadded:: 0.6.0
"""

with open(
join(package_path('key_positions'), 'iso_positions.json')
) as iso_fp:
_iso_positions = {
key: tuple(value) for key, value in load(iso_fp).items()
}
_iso_positions = {
'A99': (4, 0.5),
'A00': (4, 1.5),
'A01': (4, 2.5),
'A02': (4, 3.5),
'A03': (4, 4.5),
'A04': (4, 5.5),
'A05': (4, 6.5),
'A06': (4, 7.5),
'A07': (4, 8.5),
'A08': (4, 9.5),
'A09': (4, 10.5),
'A10': (4, 11.5),
'A11': (4, 12.5),
'A12': (4, 13.5),
'A13': (4, 14.5),
'A14': (4, 15.5),
'B99': (3, 0.25),
'B00': (3, 1.25),
'B01': (3, 2.25),
'B02': (3, 3.25),
'B03': (3, 4.25),
'B04': (3, 5.25),
'B05': (3, 6.25),
'B06': (3, 7.25),
'B07': (3, 8.25),
'B08': (3, 9.25),
'B09': (3, 10.25),
'B10': (3, 11.25),
'B11': (3, 12.25),
'B12': (3, 13.25),
'B13': (3, 14.25),
'B14': (3, 15.25),
'C99': (2, -0.25),
'C00': (2, 0.75),
'C01': (2, 1.75),
'C02': (2, 2.75),
'C03': (2, 3.75),
'C04': (2, 4.75),
'C05': (2, 5.75),
'C06': (2, 6.75),
'C07': (2, 7.75),
'C08': (2, 8.75),
'C09': (2, 9.75),
'C10': (2, 10.75),
'C11': (2, 11.75),
'C12': (2, 12.75),
'C13': (2, 13.75),
'C14': (2, 14.75),
'D99': (1, -0.5),
'D00': (1, 0.5),
'D01': (1, 1.5),
'D02': (1, 2.5),
'D03': (1, 3.5),
'D04': (1, 4.5),
'D05': (1, 5.5),
'D06': (1, 6.5),
'D07': (1, 7.5),
'D08': (1, 8.5),
'D09': (1, 9.5),
'D10': (1, 10.5),
'D11': (1, 11.5),
'D12': (1, 12.5),
'D13': (1, 13.5),
'D14': (1, 14.5),
'E99': (0, -1.0),
'E00': (0, 0.0),
'E01': (0, 1.0),
'E02': (0, 2.0),
'E03': (0, 3.0),
'E04': (0, 4.0),
'E05': (0, 5.0),
'E06': (0, 6.0),
'E07': (0, 7.0),
'E08': (0, 8.0),
'E09': (0, 9.0),
'E10': (0, 10.0),
'E11': (0, 11.0),
'E12': (0, 12.0),
'E13': (0, 13.0),
'E14': (0, 14.0),
}

_qwerty = { # Save the windows-en keymap (mostly) as a base case
frozenset({}): {
Expand Down

0 comments on commit 9832941

Please sign in to comment.