pattern.shell
pattern.en parser
You can run the parser from inside the folder that contains the pattern module:
> python -m pattern.en.parser -f lewiscarroll.txt
If no options are given a full parse is executed (i.e. tokenization, tagging, chunking, relations and lemmata). Otherwise, you need to explicitly list every required option:
-O | --tokenize | Tokenize the input. |
-T | --tags | Parse part-of-speech tags. |
-C | --chunks | Parse chunks and PNP tags. |
-R | --relations | Find verb/predicate relations. |
-L | --lemmata | Find word lemmata. |
-I | --light | Disable contextual rules. |
-f | --file | Input filename. |
-s | --string | Input string. |
-e | --encoding | Specify character encoding (utf-8 by default). |
-v | --version | Current version of pattern. |
Short options can be concatenated: python -m pattern.en.parser -OTLI -f lewiscarroll.txt
pattern.nl parser
The Dutch parser works in the same way:
> python -m pattern.nl.parser xml -s "Het wordt steeds vreemder."