Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
HLasse committed Aug 31, 2021
1 parent 64f9f17 commit 8c27773
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion textdescriptives/about.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__title__ = "textdescriptives"
__version__ = "1.0.3" # the ONLY source of version ID
__version__ = "1.0.4" # the ONLY source of version ID
__download_url__ = "https://github.com/HLasse/textdescriptives"
4 changes: 1 addition & 3 deletions textdescriptives/components/pos_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@Language.factory("pos_stats")
def create_pos_stats_component(nlp: Language, name: str):
"""Allows PosStats to be added to a spaCy pipe using nlp.add_pipe("pos_stats").
If the pipe does not contain a tagger, is is silently added."""
If the pipe does not contain a tagger, it is silently added."""

tagger = set(["tagger"])
if not tagger.intersection(set(nlp.pipe_names)):
Expand All @@ -36,9 +36,7 @@ def pos_proportions(self, doc: Doc) -> dict:
Dict with proportions of part-of-speech tag in doc.
"""
pos_counts = Counter()

pos_counts.update([token.tag_ for token in doc])

pos_proportions = {tag : pos_counts[tag] / sum(pos_counts.values()) for tag in pos_counts}

return pos_proportions

0 comments on commit 8c27773

Please sign in to comment.