├── test ├── math.tex ├── clean.tex └── dirty.tex ├── rules ├── cliche ├── passive-voice ├── bad-words ├── foolish-phrases ├── misspellings ├── latex-checking ├── barrass ├── networking-research ├── common-typos ├── my-rules ├── day-gastel └── verbose-phrases ├── .gitignore ├── style-check.gemspec ├── Makefile ├── style-censor ├── README.md ├── README.html ├── style-check.rb ├── COPYING └── LICENSE /test/math.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} 2 | \begin{document} 3 | Hello $1<2$. 4 | \end{document} 5 | -------------------------------------------------------------------------------- /rules/cliche: -------------------------------------------------------------------------------- 1 | dig deeper % phrase cliche 2 | attack these problems % phrase bobby dislikes 3 | crack these problems % phrase bobby dislikes 4 | attack this problem % phrase bobby dislikes 5 | crack this problem % phrase bobby dislikes 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CVS default ignores begin 2 | tags 3 | TAGS 4 | .make.state 5 | .nse_depinfo 6 | *~ 7 | #* 8 | .#* 9 | ,* 10 | _$* 11 | *$ 12 | *.old 13 | *.bak 14 | *.BAK 15 | *.orig 16 | *.rej 17 | .del-* 18 | *.a 19 | *.olb 20 | *.o 21 | *.obj 22 | *.so 23 | *.exe 24 | *.Z 25 | *.elc 26 | *.ln 27 | core 28 | # CVS default ignores end 29 | README 30 | style-check-*.tar.gz 31 | -------------------------------------------------------------------------------- /test/clean.tex: -------------------------------------------------------------------------------- 1 | \begin{comment} 2 | some bad stuff that is in the comment environment and should be ignored. 3 | we we 4 | behavior 5 | fashion 6 | \end{comment} 7 | A user did what a user does. % an exception to the an vowel/a consonant rule 8 | A CD player needs a AA battery. % an exception to the an vowel/a consonant rule 9 | Is an RFID tag small? 10 | An RFID tag is small. 11 | \verb+bad things can happen in verbatim environments for the forseeable future+ 12 | \caption{This caption is short.} 13 | \caption[Lorem ipsum dolor sit amet.]{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed tincidunt purus id mauris. Morbi euismod turpis eu lacus. Nam tempor.} 14 | $the actual impact of a number of$ % math mode exemption. 15 | A user reported a uniformly stupid set of bugs. 16 | \url{http://www.example.com/} 17 | \todo{don't leverage the pudding} 18 | NSF likes the phrase research impact. 19 | I like my coffee. 20 | -------------------------------------------------------------------------------- /style-check.gemspec: -------------------------------------------------------------------------------- 1 | 2 | Gem::Specification.new do |s| 3 | s.name = 'style-check' 4 | s.version = '0.15' 5 | s.date = '2014-12-06' 6 | s.summary = "Style checker for LaTeX" 7 | s.description = "style-check.rb searches latex-formatted text in search of forbidden phrases and 8 | prints error messages formatted as if from a compiler." 9 | s.authors = ["Neil Spring"] 10 | s.email = 'nspring@cs.umd.edu' 11 | s.files = ["bin/style-check.rb", "lib/style-check.rb" ] + Dir["lib/rules/*"] 12 | 13 | s.platform = Gem::Platform::RUBY 14 | s.require_paths = [ 'lib' ] 15 | s.extensions = Dir['ext/**/extconf.rb'] 16 | 17 | s.executables = [ "style-check.rb" ] 18 | s.test_files = Dir["test/**/test_*.rb"] 19 | s.homepage = 20 | 'http://www.scriptroute.org/' 21 | s.license = 'GPL' 22 | s.post_install_message = "Now run: \n% style-check.rb *.tex" 23 | end 24 | 25 | # Local Variables: 26 | # compile-command: "gem build style-check.gemspec" 27 | # End: 28 | -------------------------------------------------------------------------------- /test/dirty.tex: -------------------------------------------------------------------------------- 1 | each line should have a failure. like this one does not capitalize a sentence. 2 | And this one uses ellipsis wrongly... 3 | A aardvark eats a ant. 4 | An aardvark lives in an burrow. 5 | For the forseeable future. 6 | \caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed tincidunt purus id mauris. Morbi euismod turpis eu lacus. Nam tempor.} 7 | \caption{\label{thelabel}Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed tincidunt purus id mauris. Morbi euismod turpis eu lacus. Nam tempor.} 8 | including apples, oranges, pears, etc. 9 | \url{www.example.com} 10 | I hope ginger does not impact the tofu 11 | gives alan information about 12 | gives the user information about 13 | forbid use of cite after a period.~\cite{foo} 14 | Previous sentence. Fooble Internet and Internet. 15 | Situation Normal all F'd Up(SNAFU) 16 | foo < bar should complain because < is another char. 17 | \emph{bar} refers to the essential bar-ness of life. 18 | \emph{bar} refers to foo. 19 | The bar is used to foo as can be seen in this sentence, which has two errors. 20 | -------------------------------------------------------------------------------- /rules/passive-voice: -------------------------------------------------------------------------------- 1 | it is possible to % phrase passive voice, try: "can" 2 | are identified by % phrase passive 3 | is shown % phrase passive. 4 | is not included in % phrase maybe this is passive 5 | there (are|is) [^\.:;]* (that|in) % phrase maybe this is passive 6 | can be evaluated % phrase avoid passive: I evaluated 7 | can be observed % phrase avoid passive: are visible 8 | # is needed % phrase passive voice 9 | is used to % phrase go active voice, or subsititute "helps" 10 | (are|were) needed[^\?] % phrase passive voice 11 | (is|are) presented in % phrase "appears in", or reword to avoid passive voice 12 | it is possible that % phrase "may" 13 | (is|are) (depicted|illustrated|sketched) in % phrase thats passive voice 14 | (is|are) shown in % phrase "shows" 15 | as can be seen in % phrase X shows that Y. 16 | there needs to be % phrase passive voice in a bad way. 17 | was designed % phrase passive voce. 18 | it may be % phrase passive "it" 19 | it is important that % phrase passive; replace with X is important because Y. 20 | -------------------------------------------------------------------------------- /rules/bad-words: -------------------------------------------------------------------------------- 1 | utilize % phrase "use" http://www.bartleby.com/64/C003/0294.html 2 | utilizes % phrase "uses" http://www.bartleby.com/64/C003/0294.html 3 | leverage % phrase "use" 4 | abstraction % phrase this is often used poorly? 5 | fashion % phrase hrm. 6 | [dw]on't % spelling do not or will not. 7 | behavioral % spelling I'm convinced we don't use this word properly. 8 | we'll % spelling we will 9 | we've % spelling we have 10 | [^r][^c][^h] impact % phrase "consequences", "effect", "result", though nsf likes "research impact" 11 | tackle % phrase "tackle" (a problem) is wimpy for "solve" or a tired metaphor for "address a challenge". 12 | thusly % phrase "thus" or "this way" or "like this" http://www.bartleby.com/64/C003/0282.html 13 | transpire % phrase "happen" 14 | so-called % phrase can be abused; it's negative. 15 | necessitate % phrase require. 16 | necessitated % phrase required. 17 | necessitates % phrase requires. 18 | loosing % spelling you almost certainly mean "losing". use "loosening" otherwise. 19 | aforementioned % phrase too pretentious. 20 | important to % phrase "valued by"? 21 | notion % phrase avoid this weak phrase. (thanks brian bershad!) 22 | -------------------------------------------------------------------------------- /rules/foolish-phrases: -------------------------------------------------------------------------------- 1 | (quite|more|very|most) unique % phrase unique is. 2 | (quite|more|very|most) abstract % phrase abstract is. 3 | tangible view % phrase mix that metaphor some more. 4 | for e\.g\. % phrase e.g. includes "for". 5 | begs the question % phrase unless you're very clever: "raises the question": http://alt-usage-english.org/excerpts/fxbegthe.html 6 | high rate of speed % phrase local news-speak. 7 | especially necessary % phrase 'especially important', necessary may be an absolute like unique. 8 | how will it effect % phrase you likely meant "affect" 9 | how it will effect % phrase you likely meant "affect" 10 | insure proper performance % phrase "ensure" 11 | especially true % phrase 'especially important', true may be an absolute like unique. 12 | to affect change % phrase "effect" change; I read this on a poster. 13 | higher results % phrase maybe higher performance or higher values. 14 | is more general then the % phrase probably "than" 15 | upper bounding % phrase "limiting" or "setting an upper bound on" 16 | in principal % phrase likely, "in principle" 17 | literally like % phrase literally means no simile. 18 | design principal % phrase likely, "design principle" 19 | -------------------------------------------------------------------------------- /rules/misspellings: -------------------------------------------------------------------------------- 1 | asess % spelling 2 | elimintate % spelling 3 | enginner % spelling 4 | experiements % spelling 5 | measurment % spelling 6 | pathlogies % spelling 7 | secrurity % spelling 8 | taht % spelling 9 | teh % spelling 10 | thrid % spelling 11 | accrurate % spelling 12 | prevalance % spelling prevalence 13 | upto % spelling not a word, should be "up to" 14 | til % spelling not a word, should be "until" 15 | thes % spelling indecisive these/the 16 | accurarte % spelling 17 | suppots % spelling 18 | privledge % spelling "privilege" I misspell it every way possible. 19 | privlege % spelling "privilege" I misspell it every way possible. 20 | priviledge % spelling "privilege" I misspell it every way possible. 21 | infomation % spelling 22 | queueing % spelling I'd love to spell it this way, but spellchecker whines. 23 | vatnage % spelling argh. 24 | hte % spelling 25 | acknowledgement % spelling acknowledgment, though what you have is technically legal, despite ispell. 26 | acknowlegement % spelling needs a d. 27 | acknowlegment % spelling needs a d. 28 | acknowledgements % spelling acknowledgment , though what you have is technically legal, despite ispell. 29 | acknowlegements % spelling needs a d. 30 | acknowlegments % spelling needs a d. 31 | targetted % spelling "targeted" 32 | desireable % spelling "desirable" 33 | fullproof % spelling found this in savage et al. traceback 34 | -------------------------------------------------------------------------------- /rules/latex-checking: -------------------------------------------------------------------------------- 1 | \{\\em [^\}]*[^\}\/]\}[:] % syntax use \emph{} or explicit italic correction {\em foo\/} 2 | \{\\em [^\}]*[:\.,]\} % syntax punctuation at the edges of italic text is not italicized 3 | [A-Z]{2,10}\.[ ]*[\n ][ ]*[A-Z] % syntax intersentence spacing should be used if a sentence ends with an acronym: "FOO\\@." 4 | \\etal[^{] % syntax it's good practice to use \etal{} to avoid bad spacing 5 | \\caption\[[^\]]*[^\.]\] % syntax short caption should end with a period. 6 | \\caption\[.*CCDF.*\] % syntax short caption should not include graph type. 7 | \\caption\[.*CDF.*\] % syntax short caption should not include graph type. 8 | \\caption\[.{0,25}\] % syntax short caption should not be too short. 9 | [ ]---[ ] % syntax the em-dash should be right up against the words. 10 | [ \n]---[ \n] % syntax the em-dash should be right up against the words. 11 | ^---[ \n] % syntax the em-dash should be right up against the words. 12 | [ \n]---$ % syntax the em-dash should be right up against the words. 13 | [ \n]--[ \n] % syntax the en-dash should be between numbers. 14 | ^--[ \n] % syntax the en-dash should be between numbers. 15 | [ \n]--$ % syntax the en-dash should be rbetween numbers. 16 | ,[~ ]\\etal % syntax no comma before etal (unless Smith, Martinez, \etal) 17 | \\etal\{\}'s % syntax eew. 18 | \\(sub)?section\{[A-Z][^}]*[ ][a-z]{5,40}[^}]*\} % syntax subsection headers should be initial capped. 19 | \\(sub)?section\{[A-Z][^}]*[^:][ ]{1,}(With|A|An|Is|And|For|To|The)[ ][^}]*\} % syntax some words needn't be capitalized 20 | [ ]\\footnote % syntax no space before footnote. 21 | ,, % syntax double comma is unlikely to be intentional. 22 | cf\.[^\\] % phrase cf. should get an escaped space "\ " 23 | [a-z]''[\.] % syntax close quotes outside the period. (doesn't seem to work.) 24 | [<>] % syntax a less than or greater than outside math mode shows other characters. 25 | in section \\ref % phrase should have ~ between section and ref 26 | section~\\ref % capitalize capitalize section when saying Section 6. 27 | \\(sub)?section\{Intro\} % syntax spell it out. 28 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | RULESFILES=bad-words barrass common-typos foolish-phrases latex-checking misspellings my-rules \ 2 | networking-research passive-voice verbose-phrases day-gastel 3 | PACKAGE=style-check 4 | VERSION=0.14 5 | SYSCONFDIR=/etc/$(PACKAGE).d 6 | PREFIX=/usr/local 7 | bindir=$(PREFIX)/bin 8 | INSTALL=install 9 | 10 | all: 11 | 12 | user-install: 13 | mkdir -p $(HOME)/.style-check.d 14 | for p in $(RULESFILES); do \ 15 | $(INSTALL) -m0644 rules/$$p $(HOME)/.style-check.d; \ 16 | done 17 | 18 | install: 19 | mkdir -p $(DESTDIR)$(SYSCONFDIR) 20 | for p in $(RULESFILES); do \ 21 | $(INSTALL) -m0644 rules/$$p $(DESTDIR)$(SYSCONFDIR); \ 22 | done 23 | mkdir -p $(DESTDIR)$(bindir) 24 | $(INSTALL) -m0755 style-check.rb $(DESTDIR)$(bindir); 25 | 26 | distdir = $(PACKAGE)-$(VERSION) 27 | am__remove_distdir = \ 28 | { test ! -d $(distdir) \ 29 | || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ 30 | && rm -fr $(distdir); }; } 31 | distdir: README Makefile 32 | $(am__remove_distdir) 33 | mkdir $(distdir) 34 | mkdir $(distdir)/rules 35 | for f in $(RULESFILES); do \ 36 | cp rules/$$f $(distdir)/rules; \ 37 | done 38 | cp Makefile COPYING style-check.rb README README.html $(distdir) 39 | mkdir $(distdir)/test 40 | cp test/*.tex $(distdir)/test 41 | 42 | $(distdir).tar.gz: distdir 43 | tar cvfz $(distdir).tar.gz $(distdir) 44 | $(am__remove_distdir) 45 | 46 | dist: $(distdir).tar.gz 47 | 48 | README: README.html 49 | cat $< | w3m -dump -T text/html > $@ 50 | 51 | check: 52 | @echo Should succeed 53 | ./style-check.rb -r rules test/clean.tex 54 | @echo Should report nothing 55 | !(./style-check.rb -r rules test/clean.tex | grep clean) 56 | @echo Should report something 57 | ./style-check.rb -r rules test/dirty.tex | grep dirty > /dev/null 58 | @echo Checks for space after line before column. 59 | ./style-check.rb -g -r rules test/dirty.tex | grep "1: 32" > /dev/null 60 | @echo Checks for html output 61 | ./style-check.rb -w -r rules test/dirty.tex | grep html > /dev/null 62 | ./style-check.rb -r rules test/math.tex 63 | ./style-check.rb test/math.tex 64 | ./style-check.rb --help > /dev/null 65 | 66 | upload: $(distdir).tar.gz 67 | scp README.html ringding.cs.umd.edu:public_html/software/style-check-readme.html 68 | scp $(distdir).tar.gz ringding.cs.umd.edu:public_html/software/ 69 | ssh ringding.cs.umd.edu "cd public_html/software && rm -f style-check-current.tar.gz && ln -s $(distdir).tar.gz style-check-current.tar.gz" 70 | -------------------------------------------------------------------------------- /rules/barrass: -------------------------------------------------------------------------------- 1 | ## I like this once in a while, for "goals" accomplish % phrase do 2 | ## A nice hint, but not a good rule. additional % phrase extra, more 3 | anticipate % phrase expect 4 | breakthrough % phrase discovery 5 | commence % phrase begin 6 | conjecture % phrase guess 7 | ## I use this correctly. consider % phrase think 8 | considerable % phrase much 9 | ## I often use this in a technical sense. construct % phrase build 10 | demonstrate % phrase show 11 | encounter % phrase meet 12 | endeavour % phrase try 13 | excepting % phrase except 14 | exhibit % phrase show 15 | fabriacate % phrase build 16 | firstly % phrase first 17 | guidelines % phrase guidance 18 | hypothesize % phrase suggest 19 | indication % phrase sign 20 | initiate % phrase start 21 | modification % phrase change 22 | possess % phrase have 23 | preventative % phrase preventive 24 | ## often I use illustrations represents % phrase is 25 | shortly % phrase soon (though best to say when) 26 | subsequently % phrase later 27 | # sufficient % phrase enough -- I often use sufficient technically. 28 | ## I don't believe in this. upon % phrase on 29 | utilisation % phrase use 30 | ## I don't believe in this. within % phrase in 31 | virtually % phrase almost 32 | currently % phrase now 33 | absolutely essential % phrase essential 34 | an actual investigation % phrase an investigation 35 | almost unique % phrase rare 36 | completely surrounded % phrase surrounded 37 | conclusive proof % phrase proof 38 | an essential condition % phrase a condition 39 | hard evidence % phrase evidence 40 | they are in fact % phrase they are 41 | few in number % phrase few 42 | a positive identification % phrase an identification 43 | quite obvious % phrase obvious 44 | real problems % phrase problems 45 | streamlined in appearance % phrase streamlined 46 | quite unique % phrase unique 47 | every individual one % phrase every one 48 | the reason for this is because % phrase because 49 | reason why % phrase reason -awu 50 | reverted back % phrase reverted 51 | related to each other % phrase related 52 | each individual person % phrase each person 53 | in actual fact % phrase in fact 54 | a specific example % phrase an example 55 | an integral part % phrase a part 56 | different varieties % phrase varieties 57 | grouped together % phrase grouped 58 | percolate down % phrase percolate 59 | eradicate completely % phrase eradicate 60 | give positive encouragement % phrase encourage 61 | -------------------------------------------------------------------------------- /rules/networking-research: -------------------------------------------------------------------------------- 1 | EBONE % capitalize a somewhat useless rule, now (we standardized on Ebone) 2 | EBone % capitalize a somewhat useless rule, now (we standardized on Ebone) 3 | IPs % phrase should be IP addresses 4 | NMI % spelling is Steve's cat's name, not a measurement system 5 | Planetlab % capitalize PlanetLab 6 | Send-Train % capitalize should be Send-train 7 | UUNET % capitalize UUnet 8 | [Rr]ate-limits % spelling "rate limits" has no hyphen, only "rate-limited" 9 | [a-z] Tier % syntax don't capitalize Tier unless at the beginning of the sentence 10 | ``no-valley'' % spelling should not be quoted, it's distracting 11 | best effort % phrase hyphenate best-effort service. 12 | bpf % capitalize 13 | ccdf % capitalize 14 | cisco % capitalize the company name 15 | city-pairs % phrase decided to hyphenate 16 | deliver route % phrase jargon redundancy 17 | euclidean % capitalize Euclidean. 18 | interdomain % spelling inter-domain 19 | internet % capitalize unless talking about an internet other than the Internet 20 | intradomain % spelling intra-domain 21 | load\bbalanc % syntax load-balanced links, hyphenate load-balancing too 22 | log-normal % spelling lognormal is one word. 23 | magic-packet % spelling don't hyphenate 24 | multiaccess % spelling multi-access (or better, multiple access) 25 | namespace % spelling two words 26 | nimi % capitalize 27 | no\bvalley % phrase hyphenate no-valley 28 | pareto % capitalize 29 | planetlab % capitalize PlanetLab 30 | points links % phrase probably wrong to have two plural nouns adjacent 31 | scriptroute % capitalize 32 | send-train % capitalize should be Send-train 33 | tier [123] % phrase should be tier-1, tier-2, or tier-3. 34 | tier-[123]s % phrase should be tier-1 ISPs 35 | ttl % capitalize 36 | weibull % capitalize proper name. 37 | PoP % syntax I think POP looks less annoying. 38 | PoPs % syntax I think POP looks less annoying. 39 | the general Internet % phrase it's just the Internet. there is only one. 40 | IP-ID % phrase spell it out 41 | handful of routers % phrase they don't fit in your hand 42 | outdegree % phrase going to use hyphenated form. 43 | network measurement algorithms % phrase you're too kind to network measurement. I haven't seen an algorithm yet. 44 | http[ ] % capitalize capitalize HTTP. 45 | linux % capitalize capitalize Linux 46 | Internet[^\.]*Internet % syntax avoid Internet twice in the same sentence? 47 | zipf % capitalize capitalize the guy's name. 48 | in network distance % phrase what is that? 49 | TIMEWAIT % spelling it's "TIME-WAIT", hyphenated in rfc 793 50 | FINWAIT % syntax it's "FIN-WAIT-1" or "FIN-WAIT-2", hyphenated in rfc 793 51 | -------------------------------------------------------------------------------- /rules/common-typos: -------------------------------------------------------------------------------- 1 | a the % phrase double article 2 | pt % syntax ? I guess avoid straggling pt's that escape tex? 3 | [ ], % syntax whitespace before comma seems wrong. 4 | ''[\.,] % syntax end quotes go outside punctuation like . and , 5 | Figure Figure % phrase pizza pizza. 6 | [ ]-[ ] % syntax a hyphen surrounded by space should probably be an emdash '---' 7 | [0-9]-[0-9] % syntax use an endash '--' for ranges 8 | [0-9]ms % syntax put a space between the number and the unit. 9 | [^egs]\. [a-z] % syntax a period usually ends a sentence, and sentences should start with a capital; doesn't apply for i.e., 10 | \. [a-z] % syntax a period usually ends a sentence, and sentences should start with a capital; "i.e." should have a comma following. 11 | [a-z]\.\. % syntax double period is rarely right, use \ldots for ellipsis 12 | [^\\]" % syntax use fancy quotes 13 | \beg\. % syntax should be e.g. as in "examples given" 14 | from to\b % phrase haven't used this properly. 15 | help help % phrase double word, that probably means the author paniced 16 | of of % phrase apparent double word. 17 | the affect % phrase should probably be 'the effect' 18 | the the % phrase apparent double word. 19 | there too few % phrase there are too few? 20 | was not was % phrase pretty much a joke if this gets matched. 21 | we we % phrase it would be oi oi in french, I guess. 22 | with on % phrase probably wrong. 23 | with with % phrase apparent double word. 24 | [\n ]--[\n ] % syntax that's an en-dash, you want an em-dash: "---" 25 | my my % phrase unlikely that's what you want, at least without a comma. (doesn't work across newlines) 26 | >From % syntax be careful when you email .tex files. I've seen this slip through into submissions. 27 | e\.t\.c\. % syntax it's et cetera; use etc. 28 | such as like % phrase pick one 29 | <<<<<<< . % syntax CVS conflict! 30 | ======= % syntax CVS conflict! 31 | >>>>>>> [0-9] % syntax CVS conflict! 32 | [;:]'' % syntax close quotes before (semi-)colons, but after commas and periods 33 | e\.g\.[\n ] % syntax should be followed with a comma, as e.g. can be read as "for example" (thanks JZ!) 34 | i\.e\.[\n ] % syntax should be followed with a comma, as i.e. can be read as "that is" (thanks JZ!) 35 | [ ]\.[\n ] % syntax stray period? 36 | further more % phrase one word: furthermore 37 | safe guard % phrase one word: safeguard 38 | that be % phrase mistake. 39 | can not % phrase cannot 40 | only only % phrase double word 41 | is is % phrase double word. 42 | they shows % phrase argh, mistake. 43 | less that than % phrase typo damage 44 | from from % phrase double word score 45 | in in % phrase "in" (common mistake) 46 | not not % phrase argh. 47 | it it % phrase argh. 48 | to illicit % phrase "to elicit" -- illicit is always an adjective. 49 | c\.f\. % phrase actually, it's cf., and you'd like cf.\ (backslash space) 50 | this lead to % phrase "led to" if past tense, "leads to" if present. 51 | on on % phrase double word. 52 | has is % phrase choose 53 | description their % phrase saw this, clearly wrong. 54 | including: % syntax I prefer no colon after including, which already says a list is coming. 55 | [a-z]\([A-Z] % syntax put a space before parens, even when introducing acronyms. 56 | without and without % phrase saw this. 57 | can be result % phrase saw this typo. 58 | 59 | -------------------------------------------------------------------------------- /rules/my-rules: -------------------------------------------------------------------------------- 1 | # such may be abused to blacklist certain words even spelled correctly. 2 | # capitalize is case sensitive, and also bracketed by non-word. 3 | # phrase and spelling are case insensitive, but bracketed by non-word characters. 4 | # syntax is case sensitive but not bracketed by non-word; probably best if used with regexes. 5 | \bet al\.[^}] % syntax use the \etal{} command instead. (or write one to italicize) 6 | \bet\. al\. % syntax use the \etal{} command, "et" needs no dot (et alii). (or write one to italicize) 7 | \bc\.f\.\b % syntax should be cf. for "confer" (latin for compare) 8 | \b$i\)[^$] % syntax leave the paren in math mode -- should be $i)$ 9 | \b$ii\)[^$] % syntax leave the paren in math mode -- should be $ii)$ 10 | \b$iii\)[^$] % syntax leave the paren in math mode -- should be $iii)$ 11 | \b$iv\)[^$] % syntax leave the paren in math mode -- should be $iv)$ 12 | \b$v\)[^$] % syntax leave the paren in math mode -- should be $v)$ 13 | \ban [b-df-gj-np-tv-z] % syntax probably meant to use "a" instead of "an", though there are exceptions. 14 | \ban [B-DF-GJ-NP-TV-Z][^A-Z/] % syntax probably meant to use "a" instead of "an", though there are exceptions (like acronyms). 15 | \b[Aa] [aeiouAEIOU](?!se|ni|A|ur|RL|ti|ne|DP) % syntax probably meant to use "an" instead of "a", though there are exceptions. (user, useful, AA, unified, uniform, unique, Europe, one, UDP; n/a doesn't work, so use {n/a}) 16 | This allows % phrase tie more explicitly: This (x) allows... 17 | try and % phrase "try to", though if you're using try as a noun in a compound sentence, this rule is wrong. 18 | impact of % phrase not a useful metaphor; try evaluation, success, effect, value. 19 | including [^\.]*etc\. % syntax "including" tells of a non-exclusive list, so "etc." is redundant. This rule will misfire if you have two lists in your sentence, but you shouldn't do that either. ;) 20 | includes [^\.]*etc\. % syntax "includes" tells of a non-exclusive list, so "etc." is redundant. This rule will misfire if you have two lists in your sentence, but you shouldn't do that either. ;) 21 | and etc\. % phrase come on. learn some latin. 22 | AT&T % syntax you poor thing, this won't compile. 23 | doesn't % phrase be formal. 24 | be occur % phrase what happens when I'm indecisive about what follows "can" 25 | up until % phrase "until" 26 | one or more % phrase probably redundant -- nonzero is probably implied. 27 | is comprise(d|s) of % phrase you probably mean "is composed of" because "comprises" is more a synonym for "contains" 28 | will be significantly different % phrase "will differ significantly" for active voice 29 | More importantly, % phrase probably means the order is wrong: put important stuff first. 30 | todo % ignoredcommand 31 | texttt % ignoredcommand 32 | due to space constraints % phrase don't whine. 33 | this paper % phrase can be ambiguous if talking about someone else's paper whether you mean the one youre writing or the one you're talking about.. 34 | the above % phrase horrible phrase that must be expunged. you might use "these" instead, but best to make the sentence stand alone. 35 | referred to above % phrase "these". 36 | (all|the|of) [0-9][ ] % phrase use words for numbers in phrases. 37 | clearly shows % phrase "clearly" is usually much. 38 | grows larger % phrase is "grows smaller" possible? grows. 39 | guarantee as much as possible % phrase then not really a guarantee "provide" 40 | affects negatively % phrase "hurts" or "harms" 41 | rely upon % phrase rely on is good enough 42 | relies upon % phrase relies on is good enough 43 | record route packets? % phrase hyphenate record-route packets 44 | record-route; % phrase leave record route alone if not modifying something else 45 | we accomplish this % phrase verbose way to get active voice. 46 | refers to the % phrase you're being wimpy in the definition. use "is" 47 | \\emph\{[a-zA-Z ]*\} refers to % syntax you're being wimpy in the definition. 48 | loss off % phrase loss of? 49 | this could % phrase this "what" could 50 | with that has % phrase probably just one 51 | simply % phrase probably isn't. 52 | to get to % phrase "to reach"? 53 | latency benefit % phrase reduction 54 | latency improvement % phrase reduction 55 | shed insight % phrase 'shed light' would seem the metaphor. 56 | increasingly more % phrase redundant 57 | I\.e\. % syntax starting a sentence with i.e. is just ugly. 58 | E\.g\. % syntax starting a sentence with e.g. is just ugly. 59 | in the large % phrase if large is a noun, bad. if it's an adjective, fine. 60 | encapsulates with % phrase seen it, don't know what it means. 61 | -------------------------------------------------------------------------------- /style-censor: -------------------------------------------------------------------------------- 1 | a the % phrase double article 2 | pt % syntax ? I guess avoid straggling pt's that escape tex? 3 | that was % phrase probably redundant 4 | # such may be abused to blacklist certain words even spelled correctly. 5 | # capitalize is case sensitive, and also bracketed by non-word. 6 | # phrase and spelling are case insensitive, but bracketed by non-word characters. 7 | # syntax is case sensitive but not bracketed by non-word; probably best if used with regexes. 8 | ''[\.,] % syntax end quotes go outside punctuation like . and , 9 | EBONE % capitalize a somewhat useless rule, now (we standardized on Ebone) 10 | EBone % capitalize a somewhat useless rule, now (we standardized on Ebone) 11 | Figure Figure % phrase pizza pizza. 12 | IPs % phrase should be IP addresses 13 | NMI % spelling is Steve's cat's name, not a measurement system 14 | Planetlab % capitalize PlanetLab 15 | Send-Train % capitalize should be Send-train 16 | UUNET % capitalize UUnet 17 | [ ]-[ ] % syntax a hyphen surrounded by space should probably be an emdash '--' 18 | [0-9]-[0-9] % syntax use an emdash '--' for ranges 19 | [0-9]ms % syntax put a space between the number and the unit. 20 | [Rr]ate-limits % spelling "rate limits" has no hyphen, only "rate-limited" 21 | [^egs]\. [a-z] % syntax a period usually ends a sentence, and sentences should start with a captial; doesn't apply when an acronym. 22 | [a-z] Tier % syntax don't capitalize Tier unless at the beginning of the sentence 23 | [a-z]\.\. % syntax double period is rarely right, use \ldots for ellipsis 24 | \" % syntax use fancy quotes 25 | \. [a-z] % syntax a period usually ends a sentence, and sentences should start with a captial; doesn't apply when an acronym. 26 | \\etal[^{] % syntax it's good practice to use \etal{} to avoid bad spacing 27 | \beg\. % syntax should be e.g. as in "examples given" 28 | ``no-valley'' % spelling should not be quoted, it's distracting 29 | a large number of % phrase you mean "many" 30 | a number of % phrase as opposed to "a letter of?" 31 | a small number of % phrase you mean "few" 32 | actually % spelling probably doesn't add 33 | and instead % phrase replace with but. 34 | asess % spelling 35 | be done % phrase if "X of Y can be done", try "Y can be Xed"; it's already passive tense. 36 | behavioral % spelling I'm convinced we don't use this word properly. 37 | best effort % phrase hyphenate best-effort service. 38 | bpf % capitalize 39 | ccdf % capitalize 40 | cisco % capitalize the company name 41 | city-pairs % phrase decided to hyphenate 42 | combining multiple % phrase as opposed to "combining one?" 43 | counting the number of % phrase counting. dude. 44 | deliver route % phrase jargon redundancy 45 | do this % phrase probably verbose if you use a pronoun for what you're doing 46 | don't % spelling do not 47 | elimintate % spelling 48 | enginner % spelling 49 | et al.[^}] % syntax use the \etal{} command instead. 50 | exists % spelling -- probably no better than "is" 51 | experiements % spelling 52 | fashion % spelling hrm 53 | from to\b % phrase haven't used this properly. 54 | help help % phrase double word, that probably means the author paniced 55 | i\)[^$] % syntax leave the paren in math mode -- should be $i)$ 56 | if it is to % phrase should be "to" (usually followed by "be X") 57 | if they are to % phrase should be "to" (usually followed by "be X") 58 | ii\)[^$] % syntax leave the paren in math mode -- should be $ii)$ 59 | iii\)[^$] % syntax leave the paren in math mode -- should be $iii)$ 60 | in different continents % phrase ON different continents, IN different countries 61 | in general % phrase unless matched with "in specific," this is usually useless 62 | in order to % phrase remove "in order" and get "to" 63 | in the past % phrase past tense is likely enough. 64 | in the way of % phrase should be "as" 65 | interdomain % spelling inter-domain 66 | internet % capitalize unless talking about an internet other than the Internet 67 | intradomain % spelling intra-domain 68 | is permitted to % phrase "may" 69 | iv\)[^$] % syntax leave the paren in math mode -- should be $iiv)$ 70 | largely opaque % phrase largely does not modify opaque 71 | load\bbalanc % syntax load-balanced links, hyphenate load-balancing too 72 | log-normal % spelling lognormal is one word. 73 | magic-packet % spelling don't hyphenate 74 | makes a new % phrase should be "creates" 75 | may not chose % phrase "may not" is future tense; "chose" is past. 76 | measurment % spelling 77 | multiaccess % spelling multi-access (or better, multiple access) 78 | namespace % spelling two words 79 | nimi % capitalize 80 | no\bvalley % phrase hyphenate no-valley 81 | note that % phrase is the rest of the paper less notable? 82 | of of % phrase apparent double word. 83 | out-degree % spelling outdegree for consistency 84 | pareto % capitalize 85 | pathlogies % spelling 86 | planetlab % capitalize PlanetLab 87 | points links % phrase probably wrong to have two plural nouns adjacent 88 | really % spelling probably doesn't add 89 | rigorously % spelling probably doesn't add, and I rarely do anything with rigor 90 | scriptroute % capitalize 91 | secrurity % spelling 92 | send-train % capitalize should be Send-train 93 | so that we may % phrase probably "to" 94 | taht % spelling 95 | teh % spelling 96 | the affect % phrase should probably be 'the effect' 97 | the the % phrase apparent double word. 98 | the way in which % phrase should be "how" or "" 99 | there too few % phrase there are too few? 100 | thrid % spelling 101 | tier [123] % phrase should be tier-1, tier-2, or tier-3. 102 | tier-[123]s % phrase should be tier-1 ISPs 103 | ttl % capitalize 104 | v\)[^$] % syntax leave the paren in math mode -- should be $v)$ 105 | value stems % phrase value is derived or offered, I think. 106 | was not was % phrase pretty much a joke if this gets matched. 107 | we we % phrase it would be oi oi in french, I guess. 108 | we'll % spelling we will 109 | we've % spelling we have 110 | web % capitalize unless you're Charlotte, we capitalize Web. 111 | weibull % capitalize 112 | with on % phrase probably wrong. 113 | with with % phrase apparent double word. 114 | -------------------------------------------------------------------------------- /rules/day-gastel: -------------------------------------------------------------------------------- 1 | a considerable amount of % phrase "much" 2 | a considerable number of % phrase "many" 3 | a decreased amount of % phrase "less" 4 | a decreased number of % phrase "fewer" 5 | a great deal of % phrase "much" 6 | a majority of % phrase "most", though 'a majority of' implies more than 50% while most implies significantly more. 7 | a number of % phrase "many" or "some" 8 | a situation in which % phrase "when" 9 | a small number of % phrase "a few" 10 | absolutely essential % phrase "essential" 11 | accounted for by the fact % phrase "because" 12 | adjacent to % phrase "near" or "next to" 13 | along the lines of % phrase "like" 14 | an adequate amount of % phrase "enough" 15 | an example of this is the fact that % phrase "for example" 16 | an order of magnitude faster % phrase "10 times as fast" 17 | apprise % phrase "inform" 18 | are of the same opinion % phrase "agree" 19 | as a consequence of % phrase "because" 20 | as a matter of fact % phrase "in fact" or leave out 21 | as a result of % phrase "because" 22 | as is the case % phrase "as happens" 23 | as of this date % phrase "today" 24 | as to % phrase "about" or leave out 25 | at a rapid rate % phrase "rapidly" or "fast" 26 | at an earlier date % phrase "soon" 27 | at no time % phrase "never" 28 | at present % phrase "now" 29 | at some future time % phrase "later" or "sometime" 30 | at the conclusion of % phrase "after" 31 | at the present time % phrase "now" 32 | at this point in time % phrase "now" 33 | based on the fact that % phrase "because" 34 | because of the fact that % phrase "because" 35 | by means of % phrase "by" or "with 36 | causal factor % phrase "cause" 37 | cognizant of % phrase "aware of" 38 | completely full % phrase "full" 39 | consensus of opinion % phrase "consensus" 40 | considerable amount of % phrase "much" 41 | contingent upon % phrase "dependent on" 42 | count the number of % phrase "count" 43 | definitely proved % phrase "proved" 44 | despite the fact that % phrase "although" 45 | due to the fact that % phrase "because" 46 | during the course of % phrase "during" or "while" 47 | during the time that % phrase "while" 48 | effectuate % phrase "cause" 49 | elucidate % phrase "explain" 50 | employ % phrase "use" 51 | enclosed herewith % phrase "enclosed" 52 | end result % phrase "result" 53 | endeavor % phrase "try" 54 | entirely eliminate % phrase "eliminate" 55 | eventuate % phrase "happen" 56 | fabricate % phrase "make" 57 | facilitate % phrase "help" 58 | fatal outcome % phrase "death" 59 | fellow colleague % phrase "colleague" 60 | fewer in number % phrase "fewer" 61 | finalize % phrase "end" 62 | first of all % phrase "first" 63 | for the purpose of % phrase "for" 64 | for the reason that % phrase "because" 65 | from the point of view of % phrase "for" 66 | future plans % phrase "plans" 67 | give an account of % phrase "describe" 68 | give rise to % phrase "cause" 69 | has been engaged in a study of % phrase "has studied" 70 | has the capability of % phrase "can" 71 | has the potential to % phrase "can" or "may" 72 | have the appearance of % phrase "look like" or "resemble" 73 | having regard to % phrase "about" 74 | immune serum % phrase "antiserum" 75 | important essentials % phrase "essentials" 76 | in a number of cases % phrase "sometimes" 77 | in a position to % phrase "able to" 78 | in a satisfactory manner % phrase "satisfactorily" 79 | in a situation in which % phrase "when" 80 | in a very real sense % phrase "in a sense" or leave out 81 | in almost all instances % phrase "nearly always" 82 | in case % phrase "if" 83 | in close proximity to % phrase "close" or "near" 84 | in connection with % phrase "about" or "concerning" 85 | in light of the fact that % phrase "because" 86 | in many cases % phrase "often" 87 | in most cases % phrase "usually" 88 | in my opinion it is not an unjustifiable assumption that % phrase "I think" 89 | in only a small number of cases % phrase "rarely" 90 | in order to % phrase "to" 91 | in relation to % phrase "toward" or "to" 92 | in respect to % phrase "about" 93 | in some cases % phrase "sometimes" 94 | in terms of % phrase "about" 95 | in the absence of % phrase "without" 96 | in the event that % phrase "if" 97 | in the most effective manner % phrase "most effectively" 98 | in the not too distant future % phrase "soon" 99 | in the not-too-distant future % phrase "soon" 100 | in the possession of % phrase "has" or "have" 101 | in this day and age % phrase "today" 102 | in view of the fact that % phrase "because" 103 | inasmuch as % phrase "for" or "as" 104 | in as much as % phrase "for" or "as" 105 | incline to the view % phrase "think" 106 | inclined to the view % phrase "thought" 107 | initiate % phrase "begin" or "start" 108 | is defined as % phrase "is" 109 | is desirous of % phrase "wants" 110 | is detrimental to % phrase "harms" 111 | is similar to % phrase "resembles" 112 | it has been reported by % phrase "___ reported" 113 | it has long been known that % phrase "I haven't looked up the reference" 114 | it is apparent that % phrase "apparently" or "clearly" 115 | it is believed that % phrase "I think" (or say who thinks) 116 | it is clear that % phrase "clearly" 117 | it is clear that much additional work will be required % phrase "I don't understand it" 118 | it is evident that % phrase probably not needed just say what happened 119 | it is generally believed % phrase "many think" 120 | it is my understanding that % phrase "I understand that" 121 | it is of interest to note that % phrase leave out 122 | it is often the case that % phrase "often" 123 | it is suggested that % phrase "I think" 124 | it is worth pointing out in this context % phrase omit 125 | it may be that % phrase "I think" or "perhaps" 126 | it may, however, be noted that % phrase "but" 127 | it should be noted that % phrase omit 128 | it was observed in the course of the experiments that % phrase "we observed" 129 | join together % phrase "join" 130 | lacked the ability to % phrase "could not" 131 | large in size % phrase "large" 132 | let me make one thing perfectly clear % phrase A snow job is coming... 133 | majority of % phrase "most" 134 | make reference to % phrase "refer to" 135 | militate against % phrase "prohibit" 136 | more often than not % phrase "usually" 137 | needless to say % phrase (leave out, and consider leaving out what follows it) 138 | new initiatives % phrase "initiatives" 139 | no later than % phrase "by" 140 | of an efficient nature % phrase "efficient" 141 | of great theoretical and practical importance % phrase "useful" 142 | of long standing % phrase "old" 143 | of the opinion that % phrase "think that" 144 | on a daily basis % phrase "daily" 145 | on account of % phrase "because" 146 | on behalf of % phrase "for" 147 | on no occasion % phrase "never" 148 | on the basis of % phrase "by" 149 | on the grounds that % phrase "because" 150 | on the part of % phrase "by" or "among" or "for" 151 | on those occasions in which % phrase "when" 152 | our attention has been called to the fact that % phrase "we belatedly discovered" 153 | owing to the fact that % phrase "because" 154 | perform % phrase "do" 155 | place a major emphasis on % phrase "stress" or "emphasize" 156 | pooled together % phrase "pooled" 157 | presents a picture similar to % phrase "resembles" 158 | previous to % phrase "before" 159 | prior to % phrase "before" 160 | determinations were performed % phrase "were determined" 161 | quantify % phrase "measure" 162 | quite a large quantity of % phrase "much" 163 | quite unique % phrase "unique" 164 | rather interesting % phrase "interesting' 165 | red in color % phrase "red" 166 | referred to as % phrase "called" 167 | regardless of the fact that % phrase "even though" 168 | relative to % phrase "about" 169 | resultant effect % phrase "result" 170 | root cause % phrase "cause" 171 | serious crisis % phrase "crisis" 172 | should prove the case that % phrase "if" 173 | smaller in size % phrase "smaller" 174 | so as to % phrase "to" 175 | subject matter % phrase "subject" 176 | subsequent to % phrase "after" 177 | sufficient % phrase "enough" 178 | take into consideration % phrase "consider" 179 | terminate % phrase "end" 180 | the fact of the matter is that % phrase (leave out) 181 | the field of % phrase just say the field name "chemistry" 182 | the great majority of % phrase "most" or "almost all" 183 | the opinion is advanced that % phrase "I think" 184 | the predominate number of % phrase "most" 185 | the question as to whether % phrase "whether" 186 | the reason is because % phrase "because" 187 | the vast majority of % phrase "most" or "almost all" 188 | there is a reason to believe % phrase "I think" 189 | they are the investigators % phrase "they" 190 | this result would seem to indicate % phrase "the result indicates" 191 | results seem to indicate % phrase "the results indicate" 192 | result seems to indicate % phrase "the result indicates" 193 | through the use of % phrase "by" or "with" 194 | to the fullest possible extent % phrase "fully" 195 | transpire % phrase "happen" 196 | ultimate % phrase "last" 197 | unanimity of opinion % phrase "agreement" 198 | until such time % phrase "until" 199 | utilization % phrase "use" 200 | utilize % phrase "use" 201 | very unique % phrase "unique" 202 | was of the opinion % phrase "believed" 203 | ways and means % phrase "ways" or "means" but not both 204 | we have insufficient knowledge % phrase "we do not know" 205 | we wish to thank % phrase "we thank" 206 | what is the explanation of % phrase "why" 207 | whether or not to % phrase "whether to" 208 | with a view to % phrase "to" 209 | with reference to % phrase "about" (or leave out) 210 | with regard to % phrase "concerning" or "about" (or leave out) 211 | with respect to % phrase "about 212 | with the exception of % phrase "except" 213 | with the result that % phrase "so that" 214 | within the realm of possibility % phrase "possible" 215 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # style-check.rb 2 | 3 | The code described in this README parses latex-formatted text in search of forbidden phrases and prints error messages formatted as if from a compiler. 4 | 5 | # Why does this code exist? 6 | 7 | This code is a weapon against collaborators who would dilute your writing with ambiguous or verbose prose. It was designed to ensure that collaborative papers appear in a consistent style: mine. 8 | 9 | I think of all activities as coding. My presentations use python scripts, not powerpoint. My writing and research posters use latex and emacs, not word or publisher. When I write code, I try to be creative and sloppy, relying on tools to identify most of my mistakes. (For example, gcc issues warnings, splint can verify some memory processes, and custom scripts can identify simple portability problems.) When writing text, I had no such tools. 10 | 11 | The style checker is one such tool. When I notice a mistake that can be identified by a regular expression, I add a forbidden expression to the style checker's ruleset. Then, when I build my latex-formatted paper, I run the style checker to seek out such phrases. 12 | 13 | It has saved me from submitting gramatically-sloppy last-minute edits. 14 | 15 | Like the warnings printed by a compiler, errors from the style checker should not be taken literally. Use your own judgement to correct sentences: make them shorter, more specific, and more varied. I cannot advise you to rely on this tool in the way I do; my approach to writing is not necessarily a good one for anyone. 16 | 17 | # How does it work? 18 | 19 | The style checker is a ruby script that seeks out files in directories /etc/style-check.d or ~/.style-check.d, or files named ~/.style-censor or ./style-censor. Each file is a list of expressions in one of four types, annotated with a justification. See the existing files for examples. 20 | 21 | ## Type 1: Syntax 22 | 23 | Syntax expressions are matched exactly. They are case-sensitive. Any regular expression will do. As a hint, "\b" will match some non-word character, like a space or newline. 24 | 25 |
[ ],       % syntax whitespace before comma seems wrong.
 26 | ''[\.,]    % syntax end quotes go outside punctuation like . and , 
 27 | [ ]-[ ]    % syntax a hyphen surrounded by space should probably be an emdash '---'
 28 | 
29 | 30 | ## Type 2: Capitalize 31 | 32 | Capitalize expressions match whole words, and are case-sensitive. Such expressions are designed to help maintain uniformity of capitalization of product and project names, like PlanetLab, Scriptroute, CoDeeN, iPod, etc. They are transparently wrapped with "\b"s to ensure that only whole words are matched. 33 | 34 |
Planetlab   % capitalize PlanetLab
 35 | planetlab   % capitalize PlanetLab
 36 | ccdf        % capitalize
 37 | cisco       % capitalize the company name
 38 | internet    % capitalize unless talking about an internet other than the Internet
 39 | ttl         % capitalize
 40 | 
41 | 42 | ## Type 3: Phrase 43 | 44 | Phrases match longer phrases such as "the foreseeable future" or ["at the end of the day"](http://www.plainenglish.co.uk/pressrelease.html). As with capitalize expressions, they are transparently wrapped with "\b"s, but are not case sensitive. Some phrases that should be forbidden include double words. 45 | 46 |
[^r][^c][^h] impact           % phrase "effect", "result", though nsf likes "research impact"
 47 | absolutely essential          % phrase essential
 48 | few in number                 % phrase few
 49 | the the                       % phrase apparent double word.
 50 | (quite|more|very|most) unique % phrase unique is.
 51 | a large number of             % phrase you mean "many"
 52 | the way in which              % phrase should be "how" or "" 
 53 | live in a vacuum              % phrase a tired metaphor that makes me want to vomit. 
 54 | 
55 | 56 | ## Type 4: Spelling 57 | 58 | Spelling expressions are internally handled just like phrases. These are useful for common misspellings or typo's. Perhaps you habitually misspell lose as loose and would prefer to have a checker complain. I habitually misspell measurment, secrurity, and experiements. 59 | 60 |
experiements % spelling
 61 | measurment   % spelling
 62 | secrurity    % spelling
 63 | taht         % spelling
 64 | teh          % spelling
 65 | privledge    % spelling "privilege" I misspell it every way possible.
 66 | privlege     % spelling "privilege" I misspell it every way possible.
 67 | priviledge   % spelling "privilege" I misspell it every way possible.
 68 | queueing     % spelling I'd love to spell it this way, but spellchecker whines.
 69 | 
70 | 71 | ## Type -1: Ignored Commands 72 | 73 | Ignore the parameter to this command. If only spell checkers were this cool. The standard ignored commands are \begin, \end, \url, \cite, \ref, \label, and a few others. You can extend this in ./censor-dict with a personal dictionary that might include, for example \todo or \hostname. The internal implementation of ignored commands is to "replace" them with ~ (the non-breaking space character) before the rest of the rules are checked, so it is possible that other rules may need to take this into account. 74 | 75 |
todo      % ignoredcommand
 76 | texttt    % ignoredcommand
 77 | 
78 | 79 | ## Built-in checking 80 | 81 | In addition to configurable rules, the style checker also seeks out common errors within the LaTeX source itself: 82 | 83 | * an unescaped percent-sign directly following a number is frequently an error. 84 | * a \cite{} tag should precede (not follow) a period. 85 | * a \cite{} tag should not be used obviously as a noun in the middle of a sentence. 86 | * paragraphs should end with the end of a sentence. 87 | 88 | Comments using \begin{comment} and \end{comment} from comment.sty are skipped. 89 | 90 | Math mode between unescaped $'s is skipped. 91 | 92 | For more detail, read the ruby code. It's shorter than this file. 93 | 94 | # How do I use it? 95 | 96 | From the style-check-(version) directory, run 97 | sudo make install 98 | to install as the superuser. As an alternative, 99 | make user-install 100 | will put the ruleset in your home-directory, but putting the style-check.rb script in your path is up to you. 101 | 102 | To run the script, 103 | style-check.rb *.tex 104 | 105 | Or, if you'd like a little justification with your scolding, 106 | style-check.rb -v *.tex 107 | 108 | # Limitations 109 | 110 | This is not a proof-reader, editor, spelling checker, or grammar checker. It can catch only some simple, common, frustrating mistakes. It is not a substitute for reading what I've listed below. It is intended only for LaTeX files. 111 | 112 | This code will not teach you to use "that" and "which" properly. It will not teach you to hyphenate. It may be used for evil. You may think my rules are stupid. 113 | 114 | There are many bugs in the code; it is not guaranteed that the style checker will find all forbidden phrases. It may become confused by nested environments. 115 | 116 | # Attitude 117 | 118 | Don't ask me to add a feature. Send me a patch. 119 | 120 | Don't complain that it's written in Ruby. My language kicks your language's ass. 121 | 122 | Don't complain about the ruleset. Invent a mechanism to override ones you don't care for. 123 | 124 | # Further Reading 125 | 126 | This section is split into two categories -- entertainment for reading that is light and fun and should help you think about writing better, and reference that may help answer harder questions. 127 | 128 | ## Entertainment 129 | 130 | The Elements of Style, by Strunk and White 131 | [http://www.bartleby.com/141/](http://www.bartleby.com/141/) 132 | 133 | Woe is I: The Grammarphobe's Guide to Better English in Plain English, by Patricia T. O'Conner. 134 | 135 | Lake Superior State University Banished Words List 136 | [http://www.lssu.edu/banished/](http://www.lssu.edu/banished/) 137 | 138 | Usage in The American Heritage Dictionary 139 | [http://www.bartleby.com/61/7.html](http://www.bartleby.com/61/7.html) 140 | 141 | alt.usage.english FAQ 142 | [http://alt-usage-english.org/fast_faq.shtml](http://alt-usage-english.org/fast_faq.shtml) 143 | 144 | How To Write A Dissertation, by Doug Comer 145 | [http://www.cs.purdue.edu/homes/dec/essay.dissertation.html](http://www.cs.purdue.edu/homes/dec/essay.dissertation.html) 146 | 147 | Plain English Campaign 148 | [http://www.plainenglish.co.uk/](http://www.plainenglish.co.uk/) 149 | 150 | Thesis Errors 151 | [https://core.ecu.edu/wuenschk/Help/ThesisDiss/therr.htm](https://core.ecu.edu/wuenschk/Help/ThesisDiss/therr.htm) 152 | 153 | How to Avoid Colloquial (Informal) Writing 154 | [http://www.wikihow.com/Avoid-Colloquial-%28Informal%29-Writing](http://www.wikihow.com/Avoid-Colloquial-%28Informal%29-Writing) 155 | 156 | Henning Schulzrinne's Notes 157 | [http://www.cs.columbia.edu/~hgs/etc/writing-style.html](http://www.cs.columbia.edu/~hgs/etc/writing-style.html) 158 | 159 | ## Reading that takes work (and reference) 160 | 161 | Rules for Writers, by Diana Hacker. 162 | 163 | The New Oxford Guide to Writing, by Thomas S. Kane. 164 | 165 | Line by Line: How to Edit Your Own Writing, by Claire Cook. 166 | 167 | ## Related Code 168 | 169 | Michael Haardt wrote GNU [diction](http://www.gnu.org/software/diction/diction.html), which is similar in that it finds and complains about bad phrases, but different in that it also notes questionable phrases (such as any use of "affect") and does not expect to check LaTeX source. Style-check focuses on forbidden phrases and common typographic errors in LaTeX code. 170 | 171 | ## To install 172 | 173 |
174 | gem install style-check 
175 | 
176 | [http://www.cs.umd.edu/~nspring/software/style-check-current.tar.gz](http://www.cs.umd.edu/~nspring/software/style-check-current.tar.gz) 177 | 178 | # Thanks 179 | 180 | Kurt Partridge for encouraging me to release this thing. 181 | 182 | Vibha Sazawal for reminding me often that there is more to writing than style. 183 | 184 | Rich Wolski for introducing me to Strunk and White, the gateway drug. 185 | 186 | Jacob Martin reported the first bug, packaged style-check for [gentoo](https://packages.gentoo.org/packages/dev-tex/style-check), and contributed a ruleset based on [Day and Gastel, "How to Write and Publish a Scientific Paper"](http://www.amazon.com/How-Write-Publish-Scientific-Paper/dp/0313330271). 187 | 188 | Indika Meedeniya noticed a few more bugs and suggested compatibility with gedit. 189 | 190 | Rudolf Mühlbauer suggested: 191 | 192 | > I use it in conjunction with vim [:make | copen]: 193 | > 194 | >
~/.vim/ftplugin/tex.vim:
195 | > set makeprg=~/opt/style-check-0.14/style-check.rb\ -v\ %
196 | > 
197 | 198 | Vinícius Vielmo Cogo provided an html output scheme. 199 | 200 | * * * 201 | 202 | [Neil Spring](mailto:nspring@cs.umd.edu) 203 | -------------------------------------------------------------------------------- /README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

style-check.rb

4 | 5 |

The code described in this README parses 6 | latex-formatted text in search of forbidden phrases and 7 | prints error messages formatted as if from a compiler. 8 | 9 |

Why does this code exist?

10 | 11 |

This code is a weapon against collaborators who would 12 | dilute your writing with ambiguous or verbose prose. It 13 | was designed to ensure that collaborative papers appear 14 | in a consistent style: mine. 15 | 16 |

I think of all activities as coding. My 17 | presentations use python scripts, not powerpoint. My 18 | writing and research posters use latex and emacs, not 19 | word or publisher. When I write code, I try to be 20 | creative and sloppy, relying on tools to identify most 21 | of my mistakes. (For example, gcc issues warnings, 22 | splint can verify some memory processes, and custom 23 | scripts can identify simple portability problems.) When 24 | writing text, I had no such tools. 25 | 26 |

The style checker is one such tool. When I notice a 27 | mistake that can be identified by a regular expression, 28 | I add a forbidden expression to the style checker's 29 | ruleset. Then, when I build my latex-formatted paper, I 30 | run the style checker to seek out such phrases. 31 | 32 |

It has saved me from submitting gramatically-sloppy 33 | last-minute edits. 34 | 35 |

Like the warnings printed by a compiler, errors from 36 | the style checker should not be taken literally. Use 37 | your own judgement to correct sentences: make them 38 | shorter, more specific, and more varied. I cannot 39 | advise you to rely on this tool in the way I do; my 40 | approach to writing is not necessarily a good one for 41 | anyone. 42 | 43 |

How does it work?

The style checker is a ruby 44 | script that seeks out files in directories 45 | /etc/style-check.d or ~/.style-check.d, or files named 46 | ~/.style-censor or ./style-censor. Each file is a list 47 | of expressions in one of four types, annotated with a 48 | justification. See the existing files for examples. 49 | 50 |

Type 1: Syntax

Syntax expressions are matched 51 | exactly. They are case-sensitive. Any regular 52 | expression will do. As a hint, "\b" will match some 53 | non-word character, like a space or newline. 54 |
 55 | [ ],       % syntax whitespace before comma seems wrong.
 56 | ''[\.,]    % syntax end quotes go outside punctuation like . and , 
 57 | [ ]-[ ]    % syntax a hyphen surrounded by space should probably be an emdash '---'
 58 | 
59 | 60 |

Type 2: Capitalize

Capitalize expressions match 61 | whole words, and are case-sensitive. Such expressions 62 | are designed to help maintain uniformity of 63 | capitalization of product and project names, like 64 | PlanetLab, Scriptroute, CoDeeN, iPod, etc. They are 65 | transparently wrapped with "\b"s to ensure that only 66 | whole words are matched. 67 | 68 |
 69 | Planetlab   % capitalize PlanetLab
 70 | planetlab   % capitalize PlanetLab
 71 | ccdf        % capitalize
 72 | cisco       % capitalize the company name
 73 | internet    % capitalize unless talking about an internet other than the Internet
 74 | ttl         % capitalize
 75 | 
76 | 77 |

Type 3: Phrase

Phrases match longer phrases 78 | such as "the foreseeable future" or "at 80 | the end of the day". As with capitalize expressions, 81 | they are transparently wrapped with "\b"s, but are not 82 | case sensitive. Some phrases that should be forbidden 83 | include double words. 84 | 85 |
 86 | [^r][^c][^h] impact           % phrase "effect", "result", though nsf likes "research impact"
 87 | absolutely essential          % phrase essential
 88 | few in number                 % phrase few
 89 | the the                       % phrase apparent double word.
 90 | (quite|more|very|most) unique % phrase unique is.
 91 | a large number of             % phrase you mean "many"
 92 | the way in which              % phrase should be "how" or "" 
 93 | live in a vacuum              % phrase a tired metaphor that makes me want to vomit.  
 94 | 
95 | 96 |

Type 4: Spelling

Spelling expressions are 97 | internally handled just like phrases. These are useful 98 | for common misspellings or typo's. Perhaps you habitually 99 | misspell lose as loose and would prefer to have a checker 100 | complain. I habitually misspell measurment, secrurity, 101 | and experiements. 102 | 103 |
104 | experiements % spelling
105 | measurment   % spelling
106 | secrurity    % spelling
107 | taht         % spelling
108 | teh          % spelling
109 | privledge    % spelling "privilege" I misspell it every way possible.
110 | privlege     % spelling "privilege" I misspell it every way possible.
111 | priviledge   % spelling "privilege" I misspell it every way possible.
112 | queueing     % spelling I'd love to spell it this way, but spellchecker whines.
113 | 
114 | 115 |

Type -1: Ignored Commands

Ignore the parameter 116 | to this command. If only spell checkers were this cool. 117 | The standard ignored commands are \begin, \end, \url, 118 | \cite, \ref, \label, and a few others. You can extend 119 | this in ./censor-dict with a personal dictionary that 120 | might include, for example \todo or \hostname. The 121 | internal implementation of ignored commands is to 122 | "replace" them with ~ (the non-breaking space character) 123 | before the rest of the rules are checked, so it is 124 | possible that other rules may need to take this into 125 | account. 126 | 127 |
128 | todo      % ignoredcommand
129 | texttt    % ignoredcommand
130 | 
131 | 132 |

Built-in checking

133 |

In addition to configurable rules, the style checker 134 | also seeks out common errors within the LaTeX source 135 | itself:

144 | 145 |

Comments using \begin{comment} and \end{comment} from 146 | comment.sty are skipped. 147 | 148 |

Math mode between unescaped $'s is skipped. 149 | 150 |

For more detail, read the ruby code. It's shorter 151 | than this file. 152 | 153 |

How do I use it?

154 | 155 | From the style-check-(version) directory, run
156 | sudo make install
157 | to install as the superuser. As an alternative,
158 | make user-install
159 | will put the 160 | ruleset in your home-directory, but putting the 161 | style-check.rb script in your path is up to you. 162 | 163 |

To run the script,
164 | style-check.rb *.tex 165 | 166 |

Or, if you'd like a little justification with your scolding,
167 | style-check.rb -v *.tex 168 | 169 |

Limitations

This is not a proof-reader, editor, 170 | spelling checker, or grammar checker. It can catch only 171 | some simple, common, frustrating mistakes. It is not a 172 | substitute for reading what I've listed below. It is intended 173 | only for LaTeX files. 174 | 175 |

This code will not teach you to use "that" and 176 | "which" properly. It will not teach you to hyphenate. 177 | It may be used for evil. You may think my rules are 178 | stupid. 179 | 180 |

There are many bugs in the code; it is not guaranteed 181 | that the style checker will find all forbidden phrases. It 182 | may become confused by nested environments. 183 | 184 | 185 |

Attitude

186 | 187 |

Don't ask me to add a feature. Send me a patch. 188 | 189 |

Don't complain that it's written in Ruby. My 190 | language kicks your language's ass. 191 | 192 |

Don't complain about the ruleset. Invent a mechanism 193 | to override ones you don't care for. 194 | 195 |

Further Reading

This section is split into two 196 | categories -- entertainment for reading that is light 197 | and fun and should help you think about writing better, 198 | and reference that may help answer harder questions. 199 | 200 |

Entertainment

201 | The Elements of Style, by Strunk and White
202 | http://www.bartleby.com/141/ 203 | 204 |

Woe is I: The Grammarphobe's Guide to Better English in Plain English, by Patricia T. O'Conner. 205 | 206 |

Lake Superior State University Banished Words List
207 | http://www.lssu.edu/banished/ 208 | 209 |

Usage in The American Heritage Dictionary
210 | http://www.bartleby.com/61/7.html 211 | 212 |

alt.usage.english FAQ
213 | http://alt-usage-english.org/fast_faq.shtml 214 | 215 |

How To Write A Dissertation, by Doug Comer
216 | http://www.cs.purdue.edu/homes/dec/essay.dissertation.html 217 | 218 |

Plain English Campaign
219 | http://www.plainenglish.co.uk/ 220 | 221 |

Thesis Errors
222 | http://core.ecu.edu/psyc/wuenschk/therr.htm 223 | 224 |

How to Avoid Colloquial (Informal) Writing
225 | http://www.wikihow.com/Avoid-Colloquial-%28Informal%29-Writing 226 | 227 |

Henning Schulzrinne's Notes


228 | http://www.cs.columbia.edu/~hgs/etc/writing-style.html 229 | 230 |

Reading that takes work (and reference)

231 |

Rules for Writers, by Diana Hacker. 232 |

The New Oxford Guide to Writing, by Thomas S. Kane. 233 |

Line by Line: How to Edit Your Own Writing, by Claire Cook. 234 | 235 | 236 |

Related Code

237 |

Michael Haardt wrote GNU diction, 239 | which is similar in that it finds and complains about 240 | bad phrases, but different in that it also notes 241 | questionable phrases (such as any use of "affect") and 242 | does not expect to check LaTeX source. Style-check 243 | focuses on forbidden phrases and common typographic 244 | errors in LaTeX code. 245 | 246 |

To download

247 | http://www.cs.umd.edu/~nspring/software/style-check-current.tar.gz 248 | 249 |

Thanks

250 |

Kurt Partridge for encouraging me to release this thing.

251 |

Vibha Sazawal for reminding me often that there is more to writing than style.

252 |

Rich Wolski for introducing me to Strunk and White, the gateway drug.

253 |

Jacob Martin reported the first bug, packaged style-check for gentoo, and contributed a ruleset based 254 | on Day 255 | and Gastel, "How to Write and Publish a Scientific Paper".

256 |

Indika Meedeniya noticed a few more bugs and suggested compatibility with gedit.

257 |

Rudolf Mühlbauer suggested:

258 | I use it in conjunction with vim [:make | copen]: 259 |
260 | ~/.vim/ftplugin/tex.vim:
261 | set makeprg=~/opt/style-check-0.14/style-check.rb\ -v\ %
262 | 
263 |
264 | 265 |
266 |
Neil Spring
267 | 268 | 269 | Last modified: Wed Aug 17 09:06:10 EDT 2011 270 | 271 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /rules/verbose-phrases: -------------------------------------------------------------------------------- 1 | a large number of % phrase you mean "many" 2 | a substantial number of % phrase how substantial? most? or just enough that can't be ignored? 3 | an insufficient number of % phrase "too few" 4 | a significant number of % phrase one is significant. consider "prohibitive" if the number is sufficient to be problematic. 5 | a number of % phrase getting the verb agreement for this useless phrase is tricky. 6 | a number of different % phrase use "different" (should have a high score) 7 | a small number of % phrase you mean "few" 8 | a low number of % phrase you mean "few" 9 | a relatively low number of % phrase you mean "few" 10 | actually % spelling probably doesn't add 11 | and instead % phrase replace with but? 12 | be done % phrase if "X of Y can be done", try "Y can be Xed"; it's already passive voice. 13 | combining multiple % phrase as opposed to "combining one?" 14 | aggregating multiple % phrase "aggregating" 15 | do this % phrase probably verbose if you use a pronoun for what you're doing 16 | exists[ ] % phrase probably no better than "is", but end of sentence may be unavoidable? 17 | if it is to % phrase should be "to" (usually followed by "be X") 18 | if they are to % phrase should be "to" (usually followed by "be X") 19 | in general % phrase unless matched with "in specific," this is usually useless; perhaps "overall" 20 | in order to % phrase remove "in order" and get "to" 21 | in the past % phrase past tense is likely enough. 22 | in the way of % phrase should be "as" 23 | counting the number of % phrase counting. dude. 24 | is permitted to % phrase "may" 25 | largely opaque % phrase largely does not modify opaque 26 | makes a new % phrase should be "creates" 27 | may not chose % phrase "may not" is future tense; "chose" is past. 28 | one should note % phrase just write it. 29 | note that % phrase is the rest of the paper less notable? 30 | Note, that % syntax not only should you not "note that", no comma after note. 31 | we note % phrase is the rest of the paper less notable? 32 | note however that % phrase is the rest of the paper less notable? 33 | it is important to note % phrase is the rest of the paper less notable? 34 | really % phrase probably doesn't add; if you think it does, use "r{}eally" -- don't change to 'in fact' 35 | rigorously % spelling probably doesn't add, and I rarely do anything with rigor 36 | the way in which % phrase should be "how" or "" 37 | the manner in which % phrase should be "how" or "" 38 | value stems % phrase value is derived or offered, I think. 39 | time at which % phrase very likely "when" 40 | place at which % phrase very likely "where" 41 | at the time % phrase very likely "when" 42 | reduced number of % phrase very likely "fewer" or maybe maybe "less" 43 | is present in % phrase present is probably redudant, try "is in" 44 | they all % phrase maybe "all xs" would be better. 45 | easy to do % phrase "feasible" or "practical" might be better. 46 | is going to % phrase "will". 47 | are going to % phrase "will". 48 | getting % phrase probably "receiving" or "querying" 49 | those are % phrase see if "those X are" is clearer? 50 | design is motivated % phrase "inspired by" is probably better than "motivated" for design 51 | locations throughout the world % phrase drop "throughout the world" 52 | e.g., as opposed to % phrase if you're giving examples, you're not talking about what isn't. drop "e.g." 53 | in addition, we also % phrase remove either "also" or "in addition" 54 | other related issues % phrase probably remove "other" 55 | the aforementioned % phrase "these xs" or "this x" would be less snooty 56 | center around % phrase (cook) a center is a point: "center on" is okay. 57 | could care less % phrase (cook) 'really? how much less could you care?' (should be couldn't) 58 | grouped together % phrase redundant. "grouped" alone should suffice. 59 | put together % phrase long: "construct" "build" or "assemble" 60 | consistent with each other % phrase redundant. "consistent" suffices. 61 | be accomplished with % phrase try "requires" "uses" "needs"? 62 | the lack of knowledge of % phrase would "X is unknown" work better? 63 | gets to know % phrase you mean "learns" 64 | trying to look like % phrase you mean "acting", "emulating", or "mimicing" 65 | has got to be % phrase "must be" 66 | got % phrase try "became" "received" ? 67 | gotten % phrase try "helped" ? 68 | live in a vacuum % phrase a tired metaphor that makes me want to vomit. 69 | positive impact % phrase try "benefit" 70 | negative impact % phrase try "harm" or "consequences" 71 | adverse impact % phrase try "harm" or "consequences" 72 | adversely impacting % phrase try "harming" or "hurting" 73 | discuss the issues of % phrase could probably drop "the issues of" unless there's a list 74 | the presence of % phrase not far from 'is', 'has', etc. 75 | does not allow % phrase consider "forbids" or "prohibits" 76 | and/or % phrase just say or. 77 | there is the potential to % phrase just say may. 78 | there is the possibility that % phrase just say might. 79 | can be achieved % phrase maybe not so good? 80 | find out % phrase perhaps determine? 81 | in the absence of % phrase perhaps without? 82 | in the presence of % phrase perhaps with? 83 | set up % phrase perhaps create, configure, or initialize 84 | in the face of % phrase can be overused. try despite? 85 | several times (at|of) % phrase discouraged by Kurt. 86 | a large degree of % phrase ick. 87 | we start by first % phrase redundant. ("first, we" or "we start by"). 88 | in general, they are usually % phrase redundant. 89 | refers to the notion % phrase define your term precisely if possible. 90 | a significant amount of % phrase probably just "significant" 91 | real practical % phrase as opposed to imaginary practical? 92 | people that are % phrase use people who are? 93 | additional detail that we add % phrase as opposed to additional detail that we subtract? 94 | in some cases and not in others % phrase "in some cases" 95 | it is known that % phrase just say it. 96 | caused due to % phrase "caused by" 97 | a result of the fact that % phrase "caused by" 98 | can be attributed to the fact that % phrase "is because" 99 | a large set of % phrase probably don't care that it is a set. 100 | a small set of % phrase probably don't care that it is a set: use 'a few' 101 | provides a look at % phrase (timid) probably mean "shows". 102 | in most cases % phrase "usually" 103 | continue into the forseeable future % phrase "continue". 104 | for the forseeable future % phrase drop. 105 | fail to successfully % phrase "fail to" is sufficient. 106 | Clearly, % syntax starting a sentence with clearly confuses me. 107 | in different continents % phrase ON different continents, IN different countries 108 | (we|to) handle % phrase use a more specific verb like address, treat, solve 109 | handling % phrase use a more specific verb like addressing, treating, solving, mitigating (unless handling errors or exceptions) 110 | For the purposes of % phrase "For" 111 | We observe that % phrase drop. 112 | some degree of % phrase "some" 113 | in the problem of % phrase (contributed by rap) 114 | conclude several things % phrase make (draw) several conclusions 115 | extra bonus % phrase "bonus" 116 | added bonus % phrase "bonus" 117 | it is important to emphasize that % phrase use diction to emphasize. 118 | it is possible that % phrase "x may y" 119 | caused due to % phrase "caused by" 120 | recent work by % phrase could maybe be dropped, as the cite will include the date. 121 | identify the location of % phrase "find" 122 | that go across % phrase "that cross" 123 | ideally, we would like % phrase "we would like" 124 | enabling the ability to % phrase "supporting" or "allowing" or "permitting" 125 | absolutely essential % phrase essential is. 126 | we essentially do % phrase essentially is a poor adverb. "The essence of our algorithm is a..." 127 | Essentially, % phrase maybe "In essence," but could also be removed. 128 | In this section (we|I) % phrase "In this section, we", or "In this section, I" 129 | essentially all % phrase "most" 130 | past experience % phrase "experience" http://www.cmu.edu/styleguide/trickywords.html 131 | particulary difficult primarily % phrase simplify 132 | intuition about why % phrase "intuition as to why" 133 | Recall from above % phrase "recall" 134 | Further, (I|we) will also % phrase drop further or also 135 | respectively % phrase unneeded. 136 | in terms of % phrase don't need this. 137 | the extent to which % phrase "how much" 138 | make sure % phrase "ensure" 139 | make up % phrase "constitute" "compose" 140 | make a decision % phrase "decide" 141 | make a guess % phrase "guess" 142 | since that time % phrase "since then" 143 | choices to make % phrase "choices" 144 | certain limitations % phrase what does 'certain' add to limitations? 145 | will [a-z]* in the future % phrase "will" 146 | business entities % phrase "businesses" 147 | rely primarily on % phrase "primarily" weakens "rely". perhaps just "use" would be simpler. 148 | has the potential to % phrase can 149 | have not yet developed % phrase "have yet to develop" 150 | to be effective, % phrase probably redundant. 151 | provide information about % phrase "tell how" "reveal" "expose" "disclose" 152 | are different, % phrase "differ" 153 | have already been % phrase "have been"? "were"? 154 | as appropriate % phrase not needed? 155 | only rarely % phrase "rarely" is probably enough. 156 | is effective at % phrase "can" 157 | foremost among them is % phrase "foremost is" would be shorter. 158 | those that have no % phrase those without 159 | that have no % phrase "without"? 160 | a variety of diverse % phrase redundant 161 | be highly valuable in % phrase simplify. 162 | the overall goal % phrase 'the goal' 163 | sometimes an? [a-z]+ will % phrase an x may 164 | this is perhaps because % phrase this may be because 165 | adding an additional % phrase redundant 166 | IP protocol % phrase redundant 167 | works well % phrase be more specific. 168 | something % phrase could eliminate. 169 | to keep from % phrase "to avoid" 170 | [\.,] since (!then) % phrase probably you mean "because" unless you're talking about time. -- "has since" is okay. 171 | performance characteristics % phrase rare that characteristics adds. 172 | takes into account % phrase considers 173 | specify particular % phrase if specifying, particular should be redundant. 174 | prototype implementation % phrase "implementation" is redundant. 175 | given a particular % phrase "given a" is probably enough 176 | described in detail (in|below) % phrase use "detailed" 177 | relatively more % phrase more is already relative. 178 | focus primarily on % phrase bad metaphor: subject of focus is singular. 179 | primary focus % phrase bad metaphor: subject of focus is singular. 180 | relatively more % phrase more is already relative. 181 | gives [a-z]+ [a-z]+ information about % phrase use "tells" x 182 | gives [a-z]+ information about % phrase use "tells" x 183 | an important question to ask is % phrase just ask it. 184 | an interesting thing % phrase avoid saying something is interesting. if you have to say it, it isn't. 185 | checks to see if % phrase "checks" or "determines" 186 | have an effect on % phrase "affect" 187 | an important question to ask is % phrase just ask it. 188 | an interesting thing % phrase avoid saying something is interesting. if you have to say it, it isn't. 189 | checks to see if % phrase "checks" or "determines" 190 | we can see % phrase "we can see" isn't formal enough. 191 | still remain % phrase "remain". 192 | change over time % phrase "change" 193 | turn into % phrase "become" 194 | looking back in retrospect % phrase pick. 195 | ensures that there will be no % phrase "prevents" 196 | does have % phrase "has" 197 | first step toward this % phrase "toward this" can probably be dropped. 198 | can potentially be % phrase "might be", or just "can be" 199 | obviates the need for % phrase just obviates x, not obviates the need for x. 200 | it is indeed % phrase "it is", though still passive. 201 | planning in advance % phrase when else might you plan? 202 | a lot of % phrase "many" 203 | keep in mind % phrase "consider" (or drop) 204 | it is clear that % phrase if clear, you don't have to say it. 205 | especially true % phrase true is an absolute, can't be especially true. 206 | making it increasingly difficult % phrase preventing, discouraging, impeding, blocking, slowing... 207 | is potentially % phrase "may be" 208 | have been [a-z]* in the past % phrase 'in the past' is redundant with tense. 209 | amount of time % phrase "duration" 210 | should ideally % phrase "should" 211 | are of great benefit to % phrase "help" or "aid" 212 | are of benefit to % phrase "help" or "aid" or "promote" 213 | important here % phrase consider "relevant" 214 | while at the same time % phrase "while" is enough. 215 | are able to % phrase can 216 | subvert the proper operation of % phrase subvert 217 | speed slow % phrase speed is probably redundant. 218 | of size no smaller than % phrase "of size" is probably redundant 219 | of size no larger than % phrase "of size" is probably redundant 220 | of size smaller than % phrase "of size" is probably redundant 221 | of size larger than % phrase "of size" is probably redundant 222 | might potentially % phrase "might" 223 | in the context of % phrase "in" avoid, if possible. 224 | increase the amount of % phrase probably just increase. 225 | show the difference between % phrase compare 226 | in addition, we also % phrase pick. 227 | overhead efficiency % phrase huh? 228 | have an effect on % phrase "affect" 229 | have a signficant effect on % phrase "affect" 230 | -------------------------------------------------------------------------------- /style-check.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # copyright 2004 Neil Spring 4 | # distributed under the terms of the GNU General Public License. 5 | 6 | # a simple script to check against a ruleset of "forbidden" 7 | # phrases and spellings. it is intended as a quick check 8 | # against verbose phrases, overused expressions, incorrect 9 | # spellings, and inconsistent capitalization or hypenation. 10 | 11 | # complexity in this script arised from handling basic tex 12 | # comments and ignoring fragments of tex that are allowed to 13 | # violate style (such as the bibtex tag inside \cite{}) 14 | 15 | # the dictionary of censored phrases is a compound of 16 | # ~/.style-censor, ./censor-dict (for historical reasons), 17 | # and /etc/style-censor, as well as all files in 18 | # ~/.style-check.d, for particularly egregious violations 19 | # (such as spelling errors and common double-word problems). 20 | 21 | # this script is not intended to substitute for a spell 22 | # checker, a grammar checker, or a proof-reader. And the 23 | # phrases listed aren't necessarily forbidden; they may 24 | # simply be discouraged. Those that are particularly weak 25 | # should be annotated with a question mark at the end of the 26 | # explanation. (the behavior of the script does not currently 27 | # depend on this syntax. someday it may.) 28 | 29 | # Bugs 30 | 31 | # - misspelled words may not be recognized if capitalized. 32 | # This is a consequence of the script's goal of watching for 33 | # uniform upper- and lower- case project names and such. 34 | 35 | # - expressions with % in them won't be matched; the % 36 | # character is reserved for explanatory text. 37 | 38 | # if run with -g, insert a space between line and column, 39 | # so that gedit linkparser.py at least parses the file and 40 | # line number 41 | 42 | require 'digest' 43 | require 'optparse' 44 | require 'pathname' 45 | 46 | # pathname concatenation joins with '/'. 47 | Home = Pathname.new(ENV["HOME"]) 48 | 49 | $options = Hash.new 50 | 51 | # can set options via ~/.style-checkrc. Settable options include: 52 | # gedit 53 | # verbose 54 | # web_output 55 | # override_rule_paths=PATH 56 | stylecheckrc = Home + ".style-checkrc" 57 | if(stylecheckrc.readable?) then 58 | File.open(stylecheckrc).each do |ln| 59 | o,val = ln.chomp.split('=') 60 | val = true unless val 61 | $options[o.to_sym] = val 62 | end 63 | end 64 | 65 | OptionParser.new do |parser| 66 | parser.banner="Usage: style-check.rb [options] tex-files-to-check" 67 | parser.on("-g", "--gedit", "Use output suitable for gedit to find file and line") { $options[:gedit] = true } 68 | parser.on("-v[LEVEL]", "--verbose", "Explain each rule the first time it is matched, or every time if using -vv") { |opt| 69 | $options[:verbose] = true 70 | $options[:really_verbose] = opt 71 | } 72 | parser.on("-w", "--web_output", "Generate output in HTML") { $options[:web_output] = true } 73 | parser.on("-rPATH", "--override_rule_paths=PATH", "Override rule path, can be either a file or directory") { |param| 74 | if(test(?d, param)) then 75 | $options[:override_rule_paths] = Dir.glob(param + "/*") 76 | elsif(test(?f, param)) then 77 | $options[:override_rule_paths] = param 78 | else 79 | puts "Could not find rule file or directory at #{param}" 80 | exit 1 81 | end 82 | } 83 | parser.on("-h", "--help", "Shows this help") { 84 | puts parser 85 | puts "Long options may also be set including them in ~/.style-checkrc" 86 | } 87 | end.parse! 88 | 89 | $exit_status = 0 90 | 91 | ignoredCommands = "ref|href|url|input|bibliography|cite|nocite|cline|newcommand|includegraphics|begin|end|label".split('|') 92 | PctCensored_phrases = Hash.new # before stripping comments 93 | PreCensored_phrases = Hash.new # before stripping cites 94 | Censored_phrases = Hash.new # the rest. 95 | PathList = if($options[:override_rule_paths]) then 96 | $options[:override_rule_paths] 97 | else 98 | Dir.glob("/etc/style-check.d/*") + 99 | Dir.glob(Home + ".style-check.d/*") + 100 | [ Home + ".style-censor", "./censor-dict", "/etc/style-censor", "./style-censor" ] 101 | end 102 | 103 | # $prefilter = nil 104 | 105 | PathList.map { |rulefilename| 106 | if ( Kernel.test(?f, rulefilename) && rulefilename !~ /~$/ ) then 107 | # $stderr.print "loading #{rulefilename}" 108 | File.open(rulefilename).each_with_index { |phr,lnnum_minus_one| 109 | #if ( ! phr.scan(~ /^# / ) then 110 | expression, reason = phr.split(/\s*%\s*/) 111 | if( reason ) then 112 | begin 113 | Censored_phrases[ 114 | case reason.split(/\s+/)[0] 115 | when 'syntax' 116 | Regexp.new(expression.chomp) 117 | when 'capitalize' 118 | Regexp.new('\b' + expression.chomp + '\b' ) 119 | when 'phrase' 120 | # $stderr.puts('\b' + expression.chomp.gsub(/ +/, '\s+').gsub(/([a-zA-Z])$/, '\1\b')) 121 | Regexp.new('\b' + expression.chomp.gsub(/ +/, '\s+').gsub(/([a-zA-Z\)])$/, '\1\b'), Regexp::IGNORECASE ) 122 | when 'spelling' 123 | Regexp.new('\b' + expression.chomp + '\b', Regexp::IGNORECASE ) 124 | when 'ignoredcommand' 125 | ignoredCommands.push(expression.chomp) 126 | nil 127 | else 128 | puts "warning: no class specified for %s at %s:%d" % [ expression, rulefilename, lnnum_minus_one + 1 ] 129 | Regexp.new('\b' + expression.chomp + '\b' ) 130 | end 131 | ] = ( reason or "" ) + " (matched '" + expression.chomp + 132 | "' in %s:%d)" % [ rulefilename, lnnum_minus_one + 1 ] 133 | # end 134 | rescue RegexpError => e 135 | $stderr.puts "#{rulefilename}:#{lnnum_minus_one + 1}: Error: #{e}" 136 | exit 1 137 | end 138 | Censored_phrases.delete(nil) 139 | end 140 | } 141 | else 142 | [] 143 | end 144 | } 145 | 146 | def emit_html_file_header 147 | if($options[:web_output]) then 148 | puts "\n\nstyle_checker.rb\n\n\n
Spelling
Capitalize
Syntax
Phrase
Undefined


" 149 | end 150 | end 151 | def emit_html_file_heading(f) 152 | if($options[:web_output]) then 153 | puts "

%s

" % [ f ] 154 | end 155 | end 156 | 157 | def emit_html_warning(file, linenum, column, problem, matchedlines, phra_hash, detected) 158 | if($options[:web_output]) then 159 | id = Digest::SHA1.hexdigest(problem.to_s+file.to_s+linenum.to_s) 160 | puts "" 161 | puts "" 164 | puts "" % [ matchedlines ] 165 | puts "" % [ problem ] 166 | if (column && phra_hash[detected]) then 167 | solution=phra_hash[detected].split("(matched") 168 | puts "" % [ solution[0] ] 169 | if (solution[1] != nil ) then 170 | puts "" % [ solution[1][0..-2] ] 171 | end 172 | end 173 | puts "
File"+file.to_s+" (line: "+linenum.to_s 162 | puts ", column: "+column.to_s if column 163 | puts ")
Original%s
Problem%s
Solution%s
Trigger%s
" 174 | end 175 | end 176 | 177 | 178 | Censored_phrases.delete_if { |regex,reason| 179 | reason.split(/\s+/)[1] =~ /ignore/ 180 | } 181 | 182 | # $prefilter = Regexp.new( "(" + Censored_phrases.keys.map { |r| r.source}.join("|") + ")" ) 183 | 184 | # thanks to Adin Rivera for reporting a little bug in the next line. 185 | PreCensored_phrases[ 186 | Regexp.new(/\.~?\\cite/) ] = "syntax ~\\cite{} should precede the period." 187 | PreCensored_phrases[ 188 | Regexp.new(/\b(from|in|and|with|see)[~ ]+\\cite/) ] = "syntax don't cite in the sentence as 'in [x]', cites are not nouns. Prefer: Smith et al.~\\cite{...} show ... ." 189 | PreCensored_phrases[ 190 | Regexp.new(/[^\.\n]\n\n/) ] = "syntax paragraphs should end with a sentence end" 191 | PreCensored_phrases[ 192 | Regexp.new(/(Table|Figure|Section)[ \n]\\ref/) ] = "syntax Table, Figure, and Section refs should have a non-breaking space" 193 | PreCensored_phrases[ 194 | Regexp.new(/(table|figure|section)~\\ref/) ] = "syntax Table, Figure, and Section refs should be capitalized" 195 | PreCensored_phrases[ 196 | Regexp.new(/\\url\{(?!http|ftp|rtsp|mailto)/) ] = "syntax ~\\url{} should start with http:// (or ftp or rtsp or maybe mailto)." 197 | 198 | PctCensored_phrases[ 199 | Regexp.new(/[0-9]%/) ] = "syntax a percent following a number is rarely an intended comment." 200 | # PctCensored_phrases[ 201 | # Regexp.new(/[<>]/) ] = "a less than or greater than outside math mode shows other characters." 202 | 203 | if(Censored_phrases.length == 0) then 204 | puts "no style-censor phrases found. write some in ./style-censor." 205 | exit 1 206 | end 207 | De_comment = Regexp.new('(([^\\\\]%.*)|(^%.*))$') 208 | # though newcommand could gobble both parameters... 209 | De_command = Regexp.new('(~?\\\\(' + ignoredCommands.join('|') + ')(\[[^\]]*\])?\{[^{}]*\})') 210 | De_verb = Regexp.new('\\\\verb(.)[^\1]*\1') 211 | De_math = Regexp.new('[^\\\\]\$.*[^\\\\]\$|^\$.*[^\\\\]\$') 212 | 213 | def do_cns(line, file, linenum, phra_hash) 214 | m = nil 215 | r = nil # so we can keep it as a side-effect of the detect call 216 | detected = nil 217 | windows_detect_bug_avoider = nil 218 | phra_hash.keys.each do |r| 219 | if ( m = r.match(line) and (line.index("\n") == nil or m.begin(0) < line.index("\n")) ) then 220 | detected = r 221 | matchedlines = ( m.end(0) <= ( line.index("\n") or 0 ) ) ? line.gsub(/\n.*/,'') : line.chomp 222 | column = m.begin(0) + 1 223 | problem = m.to_s.tr("\n", ' ') 224 | if($options[:web_output]) then 225 | emit_html_warning(file, linenum, column, problem, matchedlines, phra_hash, detected) 226 | else 227 | puts "%s:%d:%s%d: %s (%s)" % [ file, linenum, $options[:gedit] ? ' ': '', column, matchedlines, problem ] 228 | end 229 | 230 | $exit_status = 1 if(! /\?\s*$/.match(phra_hash[detected])) 231 | if($options[:verbose] && phra_hash[detected]) then 232 | puts " " + phra_hash[detected] 233 | # don't print the reason more than once, unless using web output 234 | phra_hash[detected] = nil unless($options[:web_output] or $options[:really_verbose]) 235 | end 236 | end 237 | end 238 | end 239 | 240 | Input_files = ARGV 241 | Input_files.delete_if { |f| 242 | if !test(?e, f) then 243 | $stderr.puts "WARNING: Input file #{f} does not exist. skipping." 244 | true 245 | else 246 | false 247 | end 248 | } 249 | emit_html_file_header 250 | Input_files.each { |f| 251 | emit_html_file_heading(f) 252 | in_multiline_comment = 0 253 | in_multiline_verbatim = false 254 | in_multiline_equation = false 255 | # load the file, contents, but drop comments and other 256 | # hidden tex command pieces 257 | lines = File.open(f).readlines 258 | lines.each_with_index { |ln,i| 259 | do_cns( ln, f, i+1, PctCensored_phrases ) 260 | ln.sub!(De_comment, '') 261 | # no, I don't know that comment environments nest and verbatim environments dont. 262 | # I have no such cluefulness. 263 | if( ln =~ /\\begin\{comment\}/ ) then 264 | in_multiline_comment+=1 265 | elsif( ln =~ /\\end\{comment\}/ ) then 266 | in_multiline_comment-=1 267 | end 268 | if( ln =~ /\\begin\{verbatim\}/ ) then 269 | in_multiline_verbatim=true 270 | elsif( ln =~ /\\end\{verbatim\}/ ) then 271 | in_multiline_verbatim=false 272 | end 273 | if( ln =~ /\\begin\{(equation|math|eqnarray)\*?\}/ ) then 274 | in_multiline_equation=true 275 | elsif( ln =~ /\\end\{(equation|math|eqnarray)\*?\}/ ) then 276 | in_multiline_equation=false 277 | end 278 | if(in_multiline_comment == 0 && ! in_multiline_verbatim && ! in_multiline_equation) then 279 | do_cns( ln, f, i+1, PreCensored_phrases ) 280 | ln.gsub!(De_command, '~') 281 | ln.gsub!(De_verb, '~') 282 | ln.gsub!(De_math, '~') 283 | do_cns( (ln + ( lines[i+1] or "" ) + ( lines[i+2] or "" )).sub(De_comment, '').sub(De_command, '~'), f, i+1, Censored_phrases ) 284 | 285 | # now try to make sure that paragraphs end with sentence 286 | # ending punctuation, such as a period, exclamation mark, 287 | # question mark, or perhaps a command-ending brace. 288 | if(lines.length > i+3) then 289 | checkstring = lines[i..(i+1)].map { |ln| 290 | ln.sub!(De_comment, ''); 291 | ln.sub!(/\\[a-z]+=[0-9]+/, ''); # tex variable assignment; I format each on its own line. 292 | ln }.join 293 | #if(checkstring =~ /SIGCOMM/) then 294 | #puts "%s:%d: argh: %s" % [ f, i, checkstring.gsub(/\n/, '\n') ]; 295 | #end 296 | if(checkstring =~ /[a-z0-9][^\.\:\!\?\n}]\n\n/) then 297 | if($options[:web_output]) then 298 | emit_html_warning(f, j, nil, "apparent bad paragraph break", checkstring.gsub(/\n/, '\n'), phra_hash, nil) 299 | else 300 | puts "\n################################################################################\n%s:l%d: apparent bad paragraph break: %s" % [ 301 | f, i+1, checkstring.gsub(/\n/, '\n') ]; 302 | end 303 | end 304 | end 305 | end 306 | } 307 | } 308 | if($options[:web_output]) then 309 | web_trailer = < 311 | 373 |

This HTML was generated by a modified version of style-check.rb software.

\n\n" 374 | EOF 375 | puts web_trailer 376 | end 377 | 378 | exit $exit_status 379 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) 19yy name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------