Skip to content

Conversation

@p16i
Copy link
Contributor

@p16i p16i commented Aug 17, 2019

related to #250

Example usages:

$ ./bin/pythainlp --help
usage: pythainlp [-h] command

positional arguments:
  command     [corpus|tokenization|soundex]

optional arguments:
  -h, --help  show this help message and exit

$  ./bin/pythainlp tokenization word  --text "ผมร<0e31>กประเทศไทย? สามารถ" --engine newmm
Using engine=newmm
ผม|รัก|ประเทศไทย|?| |สามารถ

$ ./bin/pythainlp tokenization syllable  --text "ผมร<0e31>กประเทศไทย? สามารถ"
Using engine=ssg
ผม~รัก~ประ~เทศ~ไทย~? ~สา~มารถ

$ ./bin/pythainlp soundex  --text "บ<0e39>รณการ" --engine lk82
บE419

@p16i p16i force-pushed the cli-improvement branch from ac77e21 to 57e5a59 Compare August 17, 2019 11:48
@pep8speaks
Copy link

pep8speaks commented Aug 17, 2019

Hello @heytitle! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-08-23 17:16:55 UTC

@coveralls
Copy link

coveralls commented Aug 17, 2019

Coverage Status

Coverage decreased (-5.3%) to 88.267% when pulling 35e5766 on cli-improvement into 0dd822f on dev.

@wannaphong
Copy link
Member


@staticmethod
def syllable(args):
print("kenize syllable")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kenize syllable ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sry for that. It's just temporary code.

@wannaphong wannaphong added this to the 2.1 milestone Aug 17, 2019
@p16i p16i changed the title (WIP) Better CLI [WIP] Better CLI Aug 18, 2019
@wannaphong
Copy link
Member

wannaphong commented Aug 22, 2019

@heytitle It's ok. Can you add Part-of-Speech (POS) tags ?

@p16i
Copy link
Contributor Author

p16i commented Aug 22, 2019

Sure! My local code was outdated, so that was why I didn't implement POS. I'm going to fix it.

@p16i
Copy link
Contributor Author

p16i commented Aug 23, 2019

POS added.

./bin/pythainlp tagging pos --text "ผม|ไม่|กิน|เผ็ด"

@wannaphongcom What do you think if we slightly change the interface of commands requiring text?

In particular, it would be better if these commands receive a file instead of just a text, and write a result into another file. For example,

./bin/pythainlp tagging pos --input some text.txt \
 --output pos-tagged.txt \
 --engine ... 

./bin/pythainlp tokenization word --input some text.txt \
 --output tokenised-word.txt \
 --engine ... 

IMHO, this is the way I would use CLIs.

@wannaphong
Copy link
Member

@heytitle I agree. It will greatly facilitate the use of the CLIs.

@p16i
Copy link
Contributor Author

p16i commented Aug 30, 2019

Do you happen to know how many people use PyThaiNLP's CLI?

I'm wondering whether we should create another PR for the receiving input as a file feature.

What do you think?

@wannaphong
Copy link
Member

@heytitle I not know number of CLI users. I agree. We should create PR for the receiving input as a file feature.

@wannaphong
Copy link
Member

Now, Can i merge this pull request?

@p16i
Copy link
Contributor Author

p16i commented Sep 1, 2019

@wannaphongcom yes

@p16i p16i changed the title [WIP] Better CLI Better CLI Sep 1, 2019
@wannaphong wannaphong merged commit 58d4d00 into dev Sep 1, 2019
@bact bact deleted the cli-improvement branch September 21, 2019 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants