Skip to content

Commit

Permalink
Merge pull request #19 from frillecode/patch-1
Browse files Browse the repository at this point in the history
Fixed to work with attribute ruler
  • Loading branch information
HLasse authored Oct 28, 2021
2 parents 342c8be + 7862cbf commit bbfe011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions textdescriptives/components/pos_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
def create_pos_stats_component(nlp: Language, name: str, use_pos: bool) -> Language:
"""Allows PosStats to be added to a spaCy pipe using nlp.add_pipe("pos_stats")"""

tagger = set(["tagger"])
tagger = {"tagger", "attribute_ruler"}
if not tagger.intersection(set(nlp.pipe_names)):
raise ValueError("The pipeline does not contain a tagger. Please load a spaCy model which includes a 'tagger' component.")
raise ValueError("The pipeline does not contain a component for POS tagging. Please load a spaCy model which includes a 'tagger' or an 'attribute ruler' component.")
return POSStatistics(nlp, use_pos=use_pos)

class POSStatistics:
Expand Down

1 comment on commit bbfe011

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage

Coverage Report
FileStmtsMissCoverMissing
textdescriptives
   init.py40100% 
   about.py30100% 
   dataframe_extract.py86693%71, 128–132
   load_components.py120100% 
textdescriptives/components
   init.py40100% 
   dependency_distance.py320100% 
   descriptive_stats.py51198%112
   pos_stats.py25292%13, 44
   readability.py720100% 
   utils.py160100% 
TOTAL305997% 

Please sign in to comment.