Skip to content

Commit

Permalink
update ~remove_valence
Browse files Browse the repository at this point in the history
  • Loading branch information
GGNoWayBack committed Mar 11, 2024
1 parent 01001b4 commit fc6e761
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cathodedataextractor/nlp/cner.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def normalize(text):
# Remove valence
def remove_valence(cem, sign='+', start=0):
idx = cem.find(sign, start)
if idx == 0:
return remove_valence(cem, start=start+1)
if idx == -1:
oxygen_idx = cem.find("O", start)
while oxygen_idx > -1:
Expand Down

0 comments on commit fc6e761

Please sign in to comment.