You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser=argparse.ArgumentParser(description="Modernize spelling of some archaic words, and replace words that may be archaically compounded with a dash to a more modern spelling. For example, replace \"ash-tray\" with \"ashtray\".")
# A good way to check if a word is "archaic" is to do a Google N-Gram search: https://books.google.com/ngrams/graph?case_insensitive=on&year_start=1800&year_end=2000&smoothing=3
93
34
# Remember that en-US and en-GB differ significantly, and just because a word might seem strange to you, doesn't mean it's not the common case in the other variant.
94
-
# If Google N-Gram shows that a word has declined significantly in usage in BOTH en-US and en-GB (or the SE editor makes an exception) then it may be a good candidate to add to this list.
35
+
# If Google N-Gram shows that a word has declined significantly in usage in BOTH en-US and en-GB (or the SE editor-in-chief makes an exception) then it may be a good candidate to add to this list.
parser=argparse.ArgumentParser(description="Modernize spelling of some archaic words, and replace words that may be archaically compounded with a dash to a more modern spelling. For example, replace \"ash-tray\" with \"ashtray\".")
#9) if starts with "tri-" or "bi-" and is followed by a vowel, add one.
80
+
#9) if starts with "tri-" or "bi-" and is followed by a vowel, add one.
81
81
ifword[:3] =="tri"andword[3] in"aeoui":
82
82
syls+=1
83
83
84
84
ifword[:2] =="bi"andword[2] in"aeoui":
85
85
syls+=1
86
86
87
-
#10) if ends with "-ian", should be counted as two syllables, except for "-tian" and "-cian"
87
+
#10) if ends with "-ian", should be counted as two syllables, except for "-tian" and "-cian"
88
88
ifword[-3:] =="ian":
89
89
#and (word[-4:] != "cian" or word[-4:] != "tian"):
90
90
ifword[-4:] =="cian"orword[-4:] =="tian":
91
91
pass
92
92
else:
93
93
syls+=1
94
94
95
-
#11) if starts with "co-" and is followed by a vowel, check if exists in the double syllable dictionary, if not, check if in single dictionary and act accordingly.
95
+
#11) if starts with "co-" and is followed by a vowel, check if exists in the double syllable dictionary, if not, check if in single dictionary and act accordingly.
#12) if starts with "pre-" and is followed by a vowel, check if exists in the double syllable dictionary, if not, check if in single dictionary and act accordingly.
105
+
#12) if starts with "pre-" and is followed by a vowel, check if exists in the double syllable dictionary, if not, check if in single dictionary and act accordingly.
106
106
ifword[:3] =="pre"andword[3] in"eaoui":
107
107
ifword[:6] inpre_one:
108
108
pass
109
109
else:
110
110
syls+=1
111
111
112
-
#13) check for "-n't" and cross match with dictionary to add syllable.
112
+
#13) check for "-n't" and cross match with dictionary to add syllable.
0 commit comments