new-words
diff new-words.py @ 37:be6336e98b3c
new-words.py started
author | igor@chub.in |
---|---|
date | Fri Jan 21 15:59:45 2011 +0200 (2011-01-21) |
parents | |
children | adbc809d3924 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/new-words.py Fri Jan 21 15:59:45 2011 +0200 1.3 @@ -0,0 +1,130 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +import optparse 1.7 + 1.8 +parser = optparse.OptionParser() 1.9 + 1.10 +parser.add_option( 1.11 + "-a", "--no-marks", 1.12 + help="don't add marks (and don't save marks added by user)", 1.13 + action="store_true", 1.14 + dest="no_marks") 1.15 + 1.16 +parser.add_option( 1.17 + "-c", "--compressed", 1.18 + help="show compressed wordlist: one word per group", 1.19 + action="store_true", 1.20 + dest="compressed") 1.21 + 1.22 +parser.add_option( 1.23 + "-k", "--known-words", 1.24 + help="put higher words that are similar to the known words (only for English)", 1.25 + action="store_true", 1.26 + dest="compressed") 1.27 + 1.28 +parser.add_option( 1.29 + "-l", "--language", 1.30 + help="specify language of text", 1.31 + action="store", 1.32 + dest="language") 1.33 + 1.34 +parser.add_option( 1.35 + "-m", "--merge-tag", 1.36 + help="merge words tagged with specified tag into the main vocabulary", 1.37 + action="store", 1.38 + dest="merge_tag") 1.39 + 1.40 +parser.add_option( 1.41 + "-M", "--merge-tagged", 1.42 + help="merge words tagged with ANY tag into the main vocabulary", 1.43 + action="store_true", 1.44 + dest="merge_tagged") 1.45 + 1.46 +parser.add_option( 1.47 + "-n", "--non-interactive", 1.48 + help="non-interactive mode (don't run vi)", 1.49 + action="store_true", 1.50 + dest="non_interactive") 1.51 + 1.52 +parser.add_option( 1.53 + "-N", "--no-filter", 1.54 + help="switch off known words filtering", 1.55 + action="store_true", 1.56 + dest="no_filter") 1.57 + 1.58 +parser.add_option( 1.59 + "-p", "--pages", 1.60 + help="work with specified pages only (pages = start-stop/total )", 1.61 + action="store", 1.62 + dest="pages") 1.63 + 1.64 +parser.add_option( 1.65 + "-r", "--remove-tag", 1.66 + help="remove subvocabulary of specified tag", 1.67 + action="store", 1.68 + dest="remove_tag") 1.69 + 1.70 +parser.add_option( 1.71 + "-s", "--text-stats", 1.72 + help="show the text statistics (percentage of known words and so on) and exit", 1.73 + action="store_true", 1.74 + dest="text_stats") 1.75 + 1.76 +parser.add_option( 1.77 + "-S", "--voc-stats", 1.78 + help="show your vocabulary statistics (number of words and word groups)", 1.79 + action="store_true", 1.80 + dest="voc_stats") 1.81 + 1.82 +parser.add_option( 1.83 + "-t", "--tag", 1.84 + help="tag known words with tag", 1.85 + action="store", 1.86 + dest="tag") 1.87 + 1.88 +parser.add_option( 1.89 + "-T", "--show-tags", 1.90 + help="tag known words with tag", 1.91 + action="store_true", 1.92 + dest="show_tags") 1.93 + 1.94 +parser.add_option( 1.95 + "-2", "--two-words", 1.96 + help="find 2 words' sequences", 1.97 + action="store_true", 1.98 + dest="two_words") 1.99 + 1.100 +parser.add_option( 1.101 + "-3", "--three-words", 1.102 + help="find 3 words' sequences", 1.103 + action="store_true", 1.104 + dest="three_words") 1.105 + 1.106 +(options, args) = parser.parse_args() 1.107 + 1.108 +def get_words(): 1.109 + pass 1.110 + 1.111 +def add_stat(): 1.112 + pass 1.113 + 1.114 +def two_and_three_words(): 1.115 + pass 1.116 + 1.117 +def grep_v_english(): 1.118 + pass 1.119 + 1.120 +def group_words(): 1.121 + pass 1.122 + 1.123 +def add_marks(): 1.124 + pass 1.125 + 1.126 +def remove_marks(): 1.127 + pass 1.128 + 1.129 +def text_from_url(): 1.130 + pass 1.131 + 1.132 +def part(): 1.133 + pass