oracc / pyoracc

Python tools for working with ORACC
GNU General Public License v3.0
12 stars 10 forks source link

Lot of clean up and cdli seperation and also, packaging done. #71

Closed jayanthkmr closed 6 years ago

codecov-io commented 6 years ago

Codecov Report

Merging #71 into master will decrease coverage by 8.46%. The diff coverage is 52.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
- Coverage   95.71%   87.24%   -8.47%     
==========================================
  Files          21       26       +5     
  Lines         840      980     +140     
==========================================
+ Hits          804      855      +51     
- Misses         36      125      +89
Impacted Files Coverage Δ
pyoracc/wrapper/cli.py 0% <0%> (ø)
pyoracc/wrapper/segment.py 0% <0%> (ø)
pyoracc/atf/oracc/atflex.py 100% <100%> (ø)
pyoracc/atf/common/atflexicon.py 100% <100%> (ø)
pyoracc/atf/oracc/atfyacc.py 100% <100%> (ø)
pyoracc/atf/common/atflex.py 100% <100%> (ø)
pyoracc/atf/common/atfyacc.py 98.65% <100%> (ø)
pyoracc/model/corpus.py 82.35% <50%> (-7.31%) :arrow_down:
pyoracc/atf/cdli/atfyacc.py 56.66% <56.66%> (ø)
pyoracc/atf/cdli/atflex.py 75% <75%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 80313c1...a9de1ff. Read the comment docs.

jayanthkmr commented 6 years ago

@raquel-ucl I have also fixed your build. It has small API changes for usage though:

Usage

To use it:

$ pyoracc --help

Only files with the .atf extension can be processed.

To run it on file:

$ pyoracc -i ./pyoracc/test/data/cdli_atf_20180104.atf -f cdli

For a fresh copy of CDLI ATF, download the data bundle here : https://github.com/cdli-gh/data/blob/master/cdliatf_unblocked.atf

To run it on oracc file:

$ pyoracc -i ./pyoracc/test/data/cdli_atf_20180104.atf -f oracc

To run it on folder:

$ pyoracc -i ./pyoracc/test/data -f cdli

To see the console messages of the tool, use --verbose switch

$ pyoracc -i ./pyoracc/test/data -f cdli --verbose

Note that using the verbose option will also create a parselog.txt file, containing the log output along with displaying it on command line. The verbose output contains the lexical symbols, the parse grammer table and the LR parsing table states.

Also note that, first time usage with any atf format will always display the parse tables irrespective of verbose switch.

If you don't give arguments, it will prompt for the path and atf file type.

Help

$ pyoracc --help
Usage: pyoracc [OPTIONS]

  My Tool does one work, and one work well.

Options:
  -i, --input_path PATH      Input the file/folder name.  [required]
  -f, --atf_type [cdli|atf]  Input the atf file type.  [required]
  -v, --verbose              Enables verbose mode
  --version                  Show the version and exit.
  --help                     Show this message and exit.

Internal Dev Usage

To run on directory

$ python  -m pyoracc.model.corpus ./pyoracc/test/data  cdli

To run on individual file

$ python -m pyoracc.atf.common.atffile ./pyoracc/test/data/cdli_atf_20180104.atf cdli True