Commits

yanchuan sim committed 93f14f3

fix spelling mistake

  • Participants
  • Parent commits 4f8ac0b

Comments (0)

Files changed (2)

File scripts/prune-vocab.py

 import ycutils.corpus
 
 parser = argparse.ArgumentParser(description='Prune vocabulary size. If freq/docfreq are < 1.0, the lower/top proportion will be used instead.')
-parser.add_argument('vocab_file', type=str, help='Vocab file to prune.')
-parser.add_argument('save_as', type=str, help='Save pruned vocabulary file.')
+parser.add_argument('vocab_file', type=str, metavar='<vocab_file>', help='Vocab file to prune.')
+parser.add_argument('save_as', type=str, metavar='<pruned_vocab>', help='File path to save pruned vocabulary file.')
 
 parser.add_argument('-f', '--min-freq', type=float, default=None, help='Minimum vocabulary frequency.')
 parser.add_argument('-F', '--max-freq', type=float, default=None, help='Maximum vocabulary frequency.')
 parser.add_argument('-D', '--max-docfreq', type=float, default=None, help='Maximum document frequency.')
 parser.add_argument('-i', '--min-idf', type=float, default=None, help='Minimum inverse document frequency.')
 parser.add_argument('-I', '--max-idf', type=float, default=None, help='Maximum inverse document frequency.')
-parser.add_argument('-x', '--exclude-terms', type=file, help='List of terms to exclude from vocabulary.')
+parser.add_argument('-x', '--exclude-terms', type=file, metavar='<exclude_file>', help='A file containing list of terms to exclude from vocabulary.')
 
 A = parser.parse_args()
 

File sphinx/scripts/prune-vocab.rst

 
 .. code-block:: none
 
-   usage: prune-vocab.py [-h] [-f MIN_FREQ] [-F MAX_FREQ] [-d MIN_DOCFREQ] [-D MAX_DOCFREQ] [-i MIN_IDF] [-I MAX_IDF] vocab_file save_as
+    usage: prune-vocab.py [-h] [-f MIN_FREQ] [-F MAX_FREQ] [-d MIN_DOCFREQ]
+                          [-D MAX_DOCFREQ] [-i MIN_IDF] [-I MAX_IDF]
+                          [-x <exclude_file>]
+                          <vocab_file> <pruned_vocab>
 
 The positional arguments are:
 
-  * ``vocab_file`` - Vocabulary file to prune (in the :class:`ycutils.corpus.CorpusVocabulary` format).
-  * ``save_as`` - File path to save pruned vocabulary file.
+  * ``<vocab_file>`` - Vocabulary file to prune (in the :class:`ycutils.corpus.CorpusVocabulary` format).
+  * ``<pruned_vocab>`` - File path to save pruned vocabulary file.
 
 Optional arguments are:
 
   * ``-f MIN_FREQ, --min-freq MIN_FREQ`` and ``-F MAX_FREQ, --max-freq MAX_FREQ`` - Specifies the minimum and maximum term frequency in pruned vocabulary file.
   * ``-d MIN_DOCFREQ, --min-docfreq MIN_DOCFREQ`` and ``-D MAX_DOCFREQ, --max-docfreq MAX_DOCFREQ`` - Specifies the minimum and maximum document frequency in pruned vocabulary file.
   * ``-i MIN_IDF, --min-idf MIN_IDF`` and ``-I MAX_IDF, --max-idf MAX_IDF`` - Specifies the minimum and maximum inverse document frequency in pruned vocabulary file.
+  * ``-x <exclude_file>, --exclude-terms <exclude_file>`` - A file containing list of terms to exclude from vocabulary.
 
 If either of ``MIN_FREQ, MAX_FREQ, MIN_DOCFREQ`` or ``MAX_DOCFREQ`` is smaller than 1.0, it will be interpreted as the smallest/largest percentage of the vocabulary instead.