MCPcopy Create free account
hub / github.com/SamuraiT/mecab-python3 / parse

Function parse

src/MeCab/cli.py:6–19  ·  view source on GitHub ↗

Parse input from stdin. This is a simple wrapper for mecab-python3 so you can test it from the command line. Like the mecab binary, it treats each line of stdin as one sentence. You can pass tagger arguments here too.

()

Source from the content-addressed store, hash-verified

4
5
6def parse():
7 """Parse input from stdin.
8
9 This is a simple wrapper for mecab-python3 so you can test it from the
10 command line. Like the mecab binary, it treats each line of stdin as one
11 sentence. You can pass tagger arguments here too.
12 """
13
14 args = ' '.join(sys.argv[1:])
15 tagger = Tagger(args)
16
17 for line in fileinput.input([]):
18 # strip the newline on output
19 print(tagger.parse(line.strip())[:-1])
20
21
22def info():

Callers

nothing calls this directly

Calls 1

TaggerClass · 0.90

Tested by

no test coverage detected