learntextvis / textkit

Command line tool for manipulating and analyzing text
MIT License
28 stars 6 forks source link

Add "Filter by POS" command #9

Open vlandham opened 8 years ago

vlandham commented 8 years ago

filterpos

will have to specify which POS's to keep.

will probably need a helper function to output all POS codes and their meanings.

Fil commented 7 years ago

So, this would be used after tokens2pos, right? As in: textkit text2words test.md | textkit tokens2pos | textkit filterpos NNP,JJ

In that case it's going to be a new type of command, one that operates on a csv file containing a list of (word,pos).

| awk '/(NNP|JJ)\r$/' already works, although the \r is not meant to be there I guess (see https://github.com/learntextvis/textkit/issues/40#issuecomment-271165000 )