Skip to main content

MREP: morpheme regular expression printer

Project description

https://travis-ci.org/unnonouno/mrep.svg?branch=master https://coveralls.io/repos/unnonouno/mrep/badge.png?branch=master

MREP is a regular expression matcher for morpheme sequences. You can find morpheme sub-sequences that match a given pattern, such as noun sequences.

Requirement

Install

$ pip install mrep

If you want to install it from its source, use setup.py.

$ python setup.py install

Usage

usage: mrep [-h] [-o] [--color {never,auto,always}] [-n] [--mecab-arg MECAB_ARG]
            PATTERN [FILE [FILE ...]]
positional arguments:
PATTERN:pattern
FILE:data file
optional arguments:
-h, --help show this help message and exit
-o, --only-matching
 print only matching
--color COLOR color mode. select from “never”, “auto” and “always”. (default: auto)
-n, --line-number
 Show line number
--mecab-arg MECAB_ARG
 argument to pass to mecab (ex: “-r /path/to/resource/file”)

Pattern

.
matches all morphemes
<surface=XXX>
matches morphemes whose surface are XXX
<pos=XXX>
matches morphemes whose POS are XXX
X*
matches repetiion of a pattern X
X|Y
matches X or Y
(X)
matches X

Example

<pos=名詞>
matches a noun
<pos=名詞>*
matches repetition of nouns
<pos=名詞>*<pos=助詞>
matches repetition of nouns and a particle
(<pos=名詞>|<pos=動詞>)*
matches repetition of nouns or verbs

License

This program is distributed under the MIT license.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mrep-0.1.1.macosx-10.4-x86_64.tar.gz (8.6 kB) Copy SHA256 hash SHA256 Dumb Binary any Oct 10, 2014
mrep-0.1.1-py2.7.egg (11.0 kB) Copy SHA256 hash SHA256 Egg 2.7 Oct 10, 2014
mrep-0.1.1.tar.gz (8.7 kB) Copy SHA256 hash SHA256 Source None Oct 10, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page