Skip to content

Commit

Permalink
add customisable col idx for col Alignments in utils.is_same_length_a…
Browse files Browse the repository at this point in the history
…lignments
  • Loading branch information
martino-vic committed Dec 15, 2023
1 parent ef28790 commit 757c74e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions loanpy/utils.py
Expand Up @@ -282,7 +282,7 @@ def is_valid_language_sequence(
return True


def is_same_length_alignments(data: List[List[str]]) -> bool:
def is_same_length_alignments(data: List[List[str]], idx=3) -> bool:
"""
Check if alignments within a cognate set have the same length.
Expand Down Expand Up @@ -313,8 +313,8 @@ def is_same_length_alignments(data: List[List[str]]) -> bool:

rownr = 0
for i in range(0, len(data)-1, 2):
first = data[i][3].split(" ")
second = data[i+1][3].split(" ")
first = data[i][idx].split(" ")
second = data[i+1][idx].split(" ")
try:
assert len(first) == len(second)
except AssertionError:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -11,8 +11,8 @@
evaluating and applying changes in horizontal and vertical lexical transfers',
long_description=open("README.rst").read(),
author='Viktor Martinović',
author_email='viktor_martinovic@eva.mpg.de',
version='3.0.3',
author_email='viktor.martinovic@hotmail.com',
version='3.0.4',
packages=find_packages(),
data_files=[("loanpy", ["loanpy/ipa_all.csv"])],
include_package_data=True,
Expand Down

0 comments on commit 757c74e

Please sign in to comment.