Skip to content

Commit

Permalink
rolled back to inventory with only canonical symbols
Browse files Browse the repository at this point in the history
reverting because the changes raise problems. re: #792
  • Loading branch information
stannam committed Dec 21, 2021
1 parent f928382 commit 7ce8666
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 1 addition & 8 deletions corpustools/corpus/classes/lexicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3269,13 +3269,6 @@ def add_word(self, word, allow_duplicates=False):
#in this case, the symbol has been given a default value of 'n' for every feature
word.transcription._list = [self.inventory[x].symbol for x in word.transcription._list]

# make shift code for adding variant segs to the inventory. Need to be removed eventually
added_default_var = False
for alt_trans in word.alt_transcriptions:
if getattr(word, alt_trans) is not None:
added_default_var = self.update_inventory(getattr(word, alt_trans))
# word.transcription._list = [self.inventory[x].symbol for x in word.transcription._list]

for d in word.descriptors:
if d not in self._attributes:
if isinstance(getattr(word, d), str):
Expand All @@ -3291,7 +3284,7 @@ def add_word(self, word, allow_duplicates=False):
word.add_attribute(a.name, a.default_value)
a.update_range(getattr(word, a.name))

return added_default or added_default_var
return added_default

def update_features(self):
for seg in self.inventory:
Expand Down
5 changes: 0 additions & 5 deletions corpustools/corpus/classes/spontaneous.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ def add_word(self, wordtoken):
wordtoken.add_attribute(a.name, a.default_value)
a.update_range(getattr(wordtoken,a.name))

added_default_var = False
if wordtoken.transcription is not None:
added_default_var = self.lexicon.update_inventory(wordtoken.transcription)
return added_default_var

def add_attribute(self, attribute, initialize_defaults = False):
"""
Add an Attribute of any type to the Discourse or replace an existing Attribute.
Expand Down

0 comments on commit 7ce8666

Please sign in to comment.