Home ›
pattern command-line interface
pattern.en parser
You can run the parser from the command-line. The pattern module should be installed (i.e., located in /site-packages, see installation instructions), or the current working directory should be the one that contains the pattern folder.
> 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. Note the xml option (which produces XML output):
> python -m pattern.nl.parser xml -s "Het wordt steeds vreemder."
