Skip to content

Commit

Permalink
Rename celexlexicon to prevent wrong imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JeltevanBoheemen committed Jan 31, 2023
1 parent 0447434 commit b74a984
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions celexlexicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* DML (dmlcd.txt): lemmas and their morphological properties
* DSL (dslcd.txt): lemmas and their syntactic properties
These files can be found in the folder celexlexicon/dutch in the code folder.
These files can be found in the folder celexlexicondata/dutch in the code folder.
We store these in the celexlexicon module in python dictionaries:
Expand Down Expand Up @@ -52,7 +52,7 @@

# initialisation
# read the celex lexicon
inputfolder = os.path.join(SD_DIR, 'celexlexicon', 'dutch')
inputfolder = os.path.join(SD_DIR, 'celexlexicondata', 'dutch')

dmwfilename = 'DMWCDOK.txt'
dmwfullname = os.path.join(inputfolder, dmwfilename)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 10 additions & 5 deletions top3000.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,28 @@
from typing import Dict, List, Tuple
from sastatypes import SynTree, DCOIPt


def ishuman(node: SynTree) -> bool:
'''
The function ishuman determines whether the node node is human
'''
lemma = getattval(node, 'lemma')
pt = getattval(node, 'pt')
vwtype = getattval(node, 'vwtype')
result = (lemma, pt ) in semlexicon and 'human' in semlexicon[(lemma, pt)]
result = (lemma, pt) in semlexicon and 'human' in semlexicon[(lemma, pt)]
result = result or vwtype == 'pers'
result = result or namepart_isa_namepart(lemma)
return result


def isanimate(node: SynTree) -> bool:
'''
The function isanimate determines whether the nde node is animate
'''

lemma = getattval(node, 'lemma')
pt = getattval(node, 'pt')
result = (lemma, pt ) in semlexicon and 'animate' in semlexicon[(lemma, pt)]
result = (lemma, pt) in semlexicon and 'animate' in semlexicon[(lemma, pt)]
return result


Expand All @@ -71,15 +73,17 @@ def transitivity(node: SynTree, tr: str) -> bool:
'''
lemma = getattval(node, 'lemma')
pt = getattval(node, 'pt')
result = (lemma, pt ) in semlexicon and tr in trlexicon[(lemma, pt)]
result = (lemma, pt) in semlexicon and tr in trlexicon[(lemma, pt)]
return result


def transitive(node: SynTree) -> bool:
'''
The function transitive determines whether node is transitive
'''
return transitivity(node, 'tr')


def pseudotr(node: SynTree) -> bool:
'''
The function pseudotr determines whether node is pseudotransitive
Expand All @@ -93,9 +97,10 @@ def intransitive(node: SynTree) -> bool:
'''
return transitivity(node, 'intr')


semicolon = ';'

filename = os.path.join(SD_DIR, r'top3000\Woordenlijsten Current.xlsx')
filename = os.path.join(SD_DIR, 'top3000', 'Woordenlijsten Current.xlsx')


lexiconheader, lexicondata = getxlsxdata(filename)
Expand All @@ -120,4 +125,4 @@ def intransitive(node: SynTree) -> bool:
genlexicon[(lemma, pt)] = gens

#next statement for debugging purposes
junk = 0
junk = 0

1 comment on commit b74a984

@oktaal
Copy link
Member

@oktaal oktaal commented on b74a984 Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed this removed the data from the pip export, because this wasn't updated in https://github.com/UUDigitalHumanitieslab/sastadev/blob/master/pypi/include.txt Should it even be there? Because it's huge and I'm not quite sure about licensing?

Please sign in to comment.