use crate::effort::qwerty::{abbrev, const_qwerty_benefit};
pub(crate) const SUPER_COMMON: &[&str] = &[
"cn", "d", "f", "hr", "hs", "i", "l", "o", "s", "v", "w", "y",
];
pub(crate) fn char_is_valid_in_abbrev_src(b: u8) -> bool {
b.is_ascii_alphabetic() || b == b'\'' || b == b' '
}
pub(crate) fn char_is_valid_in_abbrev_tgt(b: u8) -> bool {
b.is_ascii_alphanumeric() || b == b'\'' || b == b',' || b == b';'
}
pub const ABBREVS: &[(&str, &str, u64)] = &[
abbrev!("about", "abt"),
abbrev!("actually", "acty"),
abbrev!("after", "af"),
abbrev!("also", "al"),
abbrev!("and", "d"),
abbrev!("aren't", "r'"),
abbrev!("are", "r"),
abbrev!("around", "ard"),
abbrev!("be", "b"),
abbrev!("because", "bc"),
abbrev!("been", "bn"),
abbrev!("before", "bf"),
abbrev!("between", "bw"),
abbrev!("but", "bt"),
abbrev!("can", "c"),
abbrev!("can't", "c'"),
abbrev!("could", "cd"),
abbrev!("couldn't", "cd'"),
abbrev!("down", "dn"),
abbrev!("especially", "esp"),
abbrev!("every", "evy"),
abbrev!("for", "f"),
abbrev!("forward", "fwd"),
abbrev!("from", "m"),
abbrev!("further", "furth"),
abbrev!("her", "hr"),
abbrev!("his", "hs"),
abbrev!("how", "hw"),
abbrev!("however", "hwv"),
abbrev!("I'd", "id"),
abbrev!("I", "i"),
abbrev!("I'll", "il"),
abbrev!("I'm", "im"),
abbrev!("into", "io"),
abbrev!("isn't", "s'"),
abbrev!("is", "s"),
abbrev!("I've", "iv"),
abbrev!("just", "j"),
abbrev!("much", "mh"),
abbrev!("need", "nd"),
abbrev!("needn't", "nd'"),
abbrev!("never", "nv"),
abbrev!("no", "n"),
abbrev!("not", "x"),
abbrev!("of", "o"),
abbrev!("okay", "k"),
abbrev!("only", "oy"),
abbrev!("otherwise", "othw"),
abbrev!("over", "ov"),
abbrev!("please", "plz"),
abbrev!("really", "rly"),
abbrev!("several", "sev"),
abbrev!("shouldn't", "sd'"),
abbrev!("should", "sd"),
abbrev!("thanks", "thx"),
abbrev!("that", "tt"),
abbrev!("the", "l"),
abbrev!("they", "e"),
abbrev!("this", "h"),
abbrev!("though", "tho"),
abbrev!("through", "thro"),
abbrev!("together", "tog"),
abbrev!("tomorrow", "tmrw"),
abbrev!("to", "t"),
abbrev!("very", "v"),
abbrev!("wasn't", "w'"),
abbrev!("was", "w"),
abbrev!("were", "ee"),
abbrev!("weren't", "ee'"),
abbrev!("will", "ll"),
abbrev!("willn't", "ll'"),
abbrev!("without", "wo"),
abbrev!("won't", "wo'"),
abbrev!("wouldn't", "wd'"),
abbrev!("would", "wd"),
abbrev!("yeah", "yh"),
abbrev!("yes", "y"),
abbrev!("you're", "u'"),
abbrev!("your", "ur"),
abbrev!("you", "u"),
abbrev!("address", "addr"), abbrev!("apartment", "aptm"),
abbrev!("apartment's", "aptm'"),
abbrev!("apartments", "aptms"),
abbrev!("apartments'", "aptms'"),
abbrev!("appointment", "appt"),
abbrev!("appointment's", "appt'"),
abbrev!("appointments", "appts"),
abbrev!("appointments'", "appts'"),
abbrev!("babies", "bbs"),
abbrev!("babies'", "bbs'"),
abbrev!("baby", "bb"),
abbrev!("baby's", "bb'"),
abbrev!("billion", "bil"),
abbrev!("billion's", "bil'"),
abbrev!("billions", "bils"),
abbrev!("billions'", "bils'"),
abbrev!("complex", "cx"),
abbrev!("context", "ctx"),
abbrev!("context's", "ctx'"),
abbrev!("contexts'", "ctxs'"),
abbrev!("department", "dept"),
abbrev!("department's", "dept'"),
abbrev!("departments", "depts"),
abbrev!("departments'", "depts'"),
abbrev!("dozen", "doz"),
abbrev!("dozen's", "doz'"),
abbrev!("dozens", "dozs"),
abbrev!("dozens'", "dozs'"),
abbrev!("email", "eml"),
abbrev!("email's", "eml'"),
abbrev!("emails", "emls"),
abbrev!("emails'", "emls'"),
abbrev!("everything", "evthg"),
abbrev!("everything's", "evthg'"),
abbrev!("government", "govt"),
abbrev!("government's", "govt'"),
abbrev!("governments", "govts"),
abbrev!("governments'", "govts'"),
abbrev!("hundred", "hun"),
abbrev!("hundred's", "hun'"),
abbrev!("hundreds", "huns"),
abbrev!("hundreds'", "huns'"),
abbrev!("information", "info"),
abbrev!("interest", "ist"),
abbrev!("interest's", "ist'"),
abbrev!("interesting", "istq"),
abbrev!("interests", "ists"),
abbrev!("interests'", "ists'"),
abbrev!("management", "mgmt"),
abbrev!("management's", "mgmt'"),
abbrev!("market", "mkt"), abbrev!("marketing", "mktq"),
abbrev!("market's", "mkt'"),
abbrev!("markets", "mkts"),
abbrev!("markets'", "mkts'"),
abbrev!("maximum", "maxm"),
abbrev!("maximum's", "maxm'"),
abbrev!("meeting", "mtg"),
abbrev!("meeting's", "mtg'"),
abbrev!("meetings", "mtgs"),
abbrev!("meetings'", "mtgs'"),
abbrev!("million", "mil"),
abbrev!("million's", "mil'"),
abbrev!("millions", "mils"),
abbrev!("millions'", "mils'"),
abbrev!("minimum", "minm"),
abbrev!("minimum's", "minm'"),
abbrev!("move", "mv"), abbrev!("moving", "mvq"),
abbrev!("move's", "mv'"),
abbrev!("moves", "mvs"),
abbrev!("moves'", "mvs'"),
abbrev!("organization", "org"),
abbrev!("organization's", "org'"),
abbrev!("organizations", "orgs"),
abbrev!("organizations'", "orgs'"),
abbrev!("other", "oth"), abbrev!("othering", "othq"),
abbrev!("other's", "oth'"),
abbrev!("others", "oths"),
abbrev!("others'", "oths'"),
abbrev!("people", "ppl"),
abbrev!("people's", "ppl'"),
abbrev!("president", "pres"),
abbrev!("president's", "pres'"),
abbrev!("presidents'", "press'"),
abbrev!("question", "q"), abbrev!("questioning", "qq"),
abbrev!("question's", "q'"),
abbrev!("questions", "qs"),
abbrev!("questions'", "qs'"),
abbrev!("request", "rqst"),
abbrev!("request's", "rqst'"),
abbrev!("requests", "rqsts"),
abbrev!("requests'", "rqsts'"),
abbrev!("requirement", "reqm"),
abbrev!("requirement's", "reqm'"),
abbrev!("requirements", "reqms"),
abbrev!("requirements'", "reqms'"),
abbrev!("right", "rt"), abbrev!("righting", "rtq"),
abbrev!("right's", "rt'"),
abbrev!("rights", "rts"),
abbrev!("rights'", "rts'"),
abbrev!("service's", "svc'"),
abbrev!("services", "svcs"),
abbrev!("services'", "svcs'"),
abbrev!("service", "svc"),
abbrev!("something", "smth"),
abbrev!("something's", "smth'"),
abbrev!("somethings", "smths"),
abbrev!("somethings'", "smths'"),
abbrev!("thing's", "tg'"),
abbrev!("things", "tgs"),
abbrev!("things'", "tgs'"),
abbrev!("thing", "tg"),
abbrev!("thousands's", "thous'"),
abbrev!("thousandss'", "thouss'"),
abbrev!("thousands", "thous"),
abbrev!("thousand", "thou"),
abbrev!("tonight's", "tn'"),
abbrev!("tonight", "tn"),
abbrev!("trillion's", "tril'"),
abbrev!("trillions", "trils"),
abbrev!("trillions'", "trils'"),
abbrev!("trillion", "tril"),
abbrev!("have", "hv"),
abbrev!("having", "hvq"),
abbrev!("keeping", "kpq"),
abbrev!("keep", "kp"),
abbrev!("knowing", "kwq"),
abbrev!("knowingly", "kwqly"),
abbrev!("know", "kw"),
abbrev!("minimize", "minz"),
abbrev!("minimizing", "minzq"),
abbrev!("maximize", "maxz"),
abbrev!("maximizing", "maxzq"),
abbrev!("good", "gd"),
abbrev!("international", "intl"),
abbrev!("internationally", "intlly"),
abbrev!("little", "lil"),
abbrev!("littlest", "lilst"),
abbrev!("major", "mjr"),
abbrev!("minor", "mnr"),
abbrev!("as far as I know", ",afaik"),
abbrev!("be right back", ",brb"),
abbrev!("for real", ",fr"),
abbrev!("for your information", ",fyi"),
abbrev!("I don't care", ",idc"),
abbrev!("I don't know", ",idk"),
abbrev!("if I remember correctly", ",iirc"),
abbrev!("if I understand correctly", ",iiuc"),
abbrev!("I love you", ",ily"),
abbrev!("I love you so much", ",ilysm"),
abbrev!("in case you missed it", ",icymi"),
abbrev!("in my honest opinion", ",imho"),
abbrev!("in my opinion", ",imo"),
abbrev!("just kidding", ",jk"),
abbrev!("looks good to me", ",lgtm"),
abbrev!("no problem", ",np"),
abbrev!("of course", ",ofc"),
abbrev!("on my way", ",omw"),
abbrev!("right now", ",rn"),
abbrev!("talk to you later", ",ttyl"),
abbrev!("talk to you soon", ",ttys"),
abbrev!("thank you so much", ",tysm"),
abbrev!("thank you", ",ty"),
abbrev!("to be honest", ",tbh"),
abbrev!("with respect to", ",wrt"),
abbrev!("you're welcome", ",yw"),
abbrev!("ain't", "ai'"),
abbrev!("didn't", "di'"),
abbrev!("don't", "do'"),
abbrev!("hadn't", "had'"),
abbrev!("hasn't", "has'"),
abbrev!("mustn't", "must'"),
abbrev!("oughtn't", "ought'"),
abbrev!("Sunday", "sund"),
abbrev!("Sundays", "sunds"),
abbrev!("Sunday's", "sund'"),
abbrev!("Sundays'", "sunds'"),
abbrev!("Monday", "mond"),
abbrev!("Mondays", "monds"),
abbrev!("Monday's", "mond'"),
abbrev!("Mondays'", "monds'"),
abbrev!("Tuesday", "tues"),
abbrev!("Tuesdays", "tuess"),
abbrev!("Tuesday's", "tues'"),
abbrev!("Tuesdays'", "tuess'"),
abbrev!("Wednesday", "weds"),
abbrev!("Wednesdays", "wedss"),
abbrev!("Wednesday's", "weds'"),
abbrev!("Wednesdays'", "wedss'"),
abbrev!("Thursday", "thur"),
abbrev!("Thursdays", "thurs"),
abbrev!("Thursday's", "thur'"),
abbrev!("Thursdays'", "thurs'"),
abbrev!("Friday", "frid"),
abbrev!("Fridays", "frids"),
abbrev!("Friday's", "frid'"),
abbrev!("Fridays'", "frids'"),
abbrev!("Saturday", "satd"),
abbrev!("Saturdays", "satds"),
abbrev!("Saturday's", "satd'"),
abbrev!("Saturdays'", "satds'"),
abbrev!("January", "jan"),
abbrev!("Januarys", "jans"),
abbrev!("January's", "jan'"),
abbrev!("Januarys'", "jans'"),
abbrev!("February", "feb"),
abbrev!("Februarys", "febs"),
abbrev!("February's", "feb'"),
abbrev!("Februarys'", "febs'"),
abbrev!("March", "mar"),
abbrev!("Marchs", "mars"),
abbrev!("March's", "mar'"),
abbrev!("Marchs'", "mars'"),
abbrev!("April", "apr"),
abbrev!("Aprils", "aprs"),
abbrev!("April's", "apr'"),
abbrev!("Aprils'", "aprs'"),
abbrev!("June", "jun"),
abbrev!("Junes", "juns"),
abbrev!("June's", "jun'"),
abbrev!("Junes'", "juns'"),
abbrev!("July", "jul"),
abbrev!("Julys", "juls"),
abbrev!("July's", "jul'"),
abbrev!("Julys'", "juls'"),
abbrev!("August", "aug"),
abbrev!("Augusts", "augs"),
abbrev!("August's", "aug'"),
abbrev!("Augusts'", "augs'"),
abbrev!("September", "sep"),
abbrev!("Septembers", "seps"),
abbrev!("September's", "sep'"),
abbrev!("Septembers'", "seps'"),
abbrev!("October", "oct"),
abbrev!("Octobers", "octs"),
abbrev!("October's", "oct'"),
abbrev!("Octobers'", "octs'"),
abbrev!("November", "nov"),
abbrev!("Novembers", "novs"),
abbrev!("November's", "nov'"),
abbrev!("Novembers'", "novs'"),
abbrev!("December", "dec"),
abbrev!("Decembers", "decs"),
abbrev!("December's", "dec'"),
abbrev!("Decembers'", "decs'"),
abbrev!("zero", "n0"),
abbrev!("one", "n1"),
abbrev!("two", "n2"),
abbrev!("three", "n3"),
abbrev!("four", "n4"),
abbrev!("five", "n5"),
abbrev!("six", "n6"),
abbrev!("seven", "n7"),
abbrev!("eight", "n8"),
abbrev!("nine", "n9"),
abbrev!("ten", "n10"),
abbrev!("eleven", "n11"),
abbrev!("twelve", "n12"),
abbrev!("thirteen", "n13"),
abbrev!("fourteen", "n14"),
abbrev!("fifteen", "n15"),
abbrev!("sixteen", "n16"),
abbrev!("seventeen", "n17"),
abbrev!("eighteen", "n18"),
abbrev!("nineteen", "n19"),
abbrev!("twenty", "n20"), abbrev!("zeroth", "o0"),
abbrev!("first", "o1"),
abbrev!("second", "o2"),
abbrev!("third", "o3"),
abbrev!("fourth", "o4"),
abbrev!("fifth", "o5"),
abbrev!("sixth", "o6"),
abbrev!("seventh", "o7"),
abbrev!("eighth", "o8"),
abbrev!("ninth", "o9"),
abbrev!("tenth", "o10"),
abbrev!("eleventh", "o11"),
abbrev!("twelfth", "o12"),
abbrev!("thirteenth", "o13"),
abbrev!("fourteenth", "o14"),
abbrev!("fifteenth", "o15"),
abbrev!("sixteenth", "o16"),
abbrev!("seventeenth", "o17"),
abbrev!("eighteenth", "o18"),
abbrev!("nineteenth", "o19"), abbrev!("twentieth", "o20"),
abbrev!("Brooklyn", ",bk"),
abbrev!("Chicago", ",chi"),
abbrev!("London", ",lon"),
abbrev!("Los Angeles", ",lax"),
abbrev!("Mexico City", ",cdmx"),
abbrev!("New York City", ",nyc"),
abbrev!("Portland", ",pdx"),
abbrev!("Seattle", ",sea"),
abbrev!("St Louis", ",stl"),
abbrev!("Alabama", ",al"),
abbrev!("Alaska", ",ak"),
abbrev!("Arizona", ",az"),
abbrev!("Arkansas", ",ar"),
abbrev!("California", ",ca"),
abbrev!("Colorado", ",co"),
abbrev!("Connecticut", ",ct"),
abbrev!("Delaware", ",de"),
abbrev!("Florida", ",fl"),
abbrev!("Georgia", ",ga"),
abbrev!("Hawaii", ",hi"),
abbrev!("Idaho", ",id"),
abbrev!("Illinois", ",il"),
abbrev!("Indiana", ",in"),
abbrev!("Iowa", ",ia"),
abbrev!("Kansas", ",ks"),
abbrev!("Kentucky", ",ky"),
abbrev!("Louisiana", ",la"),
abbrev!("Maine", ",me"),
abbrev!("Maryland", ",md"),
abbrev!("Massachusetts", ",ma"),
abbrev!("Michigan", ",mi"),
abbrev!("Minnesota", ",mn"),
abbrev!("Mississippi", ",ms"),
abbrev!("Missouri", ",mo"),
abbrev!("Montana", ",mt"),
abbrev!("Nebraska", ",ne"),
abbrev!("Nevada", ",nv"),
abbrev!("New Hampshire", ",nh"),
abbrev!("New Jersey", ",nj"),
abbrev!("New Mexico", ",nm"),
abbrev!("New York", ",ny"),
abbrev!("North Carolina", ",nc"),
abbrev!("North Dakota", ",nd"),
abbrev!("Ohio", ",oh"),
abbrev!("Oklahoma", ",ok"),
abbrev!("Oregon", ",or"),
abbrev!("Pennsylvania", ",pa"),
abbrev!("Rhode Island", ",ri"),
abbrev!("South Carolina", ",sc"),
abbrev!("South Dakota", ",sd"),
abbrev!("Tennessee", ",tn"),
abbrev!("Texas", ",tx"),
abbrev!("Utah", ",ut"),
abbrev!("Vermont", ",vt"),
abbrev!("Virginia", ",va"),
abbrev!("Washington", ",wa"),
abbrev!("West Virginia", ",wv"),
abbrev!("Wisconsin", ",wi"),
abbrev!("Wyoming", ",wy"),
abbrev!("Afghanistan", "c,af"),
abbrev!("Albania", "c,al"),
abbrev!("Algeria", "c,dz"),
abbrev!("American Samoa", "c,as"),
abbrev!("Andorra", "c,ad"),
abbrev!("Angola", "c,ao"),
abbrev!("Anguilla", "c,ai"),
abbrev!("Antarctica", "c,aq"),
abbrev!("Antigua and Barbuda", "c,ag"),
abbrev!("Argentina", "c,ar"),
abbrev!("Armenia", "c,am"),
abbrev!("Aruba", "c,aw"),
abbrev!("Australia", "c,au"),
abbrev!("Austria", "c,at"),
abbrev!("Azerbaijan", "c,az"),
abbrev!("Bahamas", "c,bs"),
abbrev!("Bahrain", "c,bh"),
abbrev!("Bangladesh", "c,bd"),
abbrev!("Barbados", "c,bb"),
abbrev!("Belarus", "c,by"),
abbrev!("Belgium", "c,be"),
abbrev!("Belize", "c,bz"),
abbrev!("Benin", "c,bj"),
abbrev!("Bermuda", "c,bm"),
abbrev!("Bhutan", "c,bt"),
abbrev!("Bolivia", "c,bo"),
abbrev!("Bosnia and Herzegovina", "c,ba"),
abbrev!("Botswana", "c,bw"),
abbrev!("Bouvet Island", "c,bv"),
abbrev!("Brazil", "c,br"),
abbrev!("British Indian Ocean Territory", "c,io"),
abbrev!("Brunei", "c,bn"),
abbrev!("Bulgaria", "c,bg"),
abbrev!("Burkina Faso", "c,bf"),
abbrev!("Burundi", "c,bi"),
abbrev!("Cambodia", "c,kh"),
abbrev!("Cameroon", "c,cm"),
abbrev!("Canada", "c,ca"),
abbrev!("Cape Verde", "c,cv"),
abbrev!("Cayman Islands", "c,ky"),
abbrev!("Central African Republic", "c,cf"),
abbrev!("Chad", "c,td"),
abbrev!("Chile", "c,cl"),
abbrev!("China", "c,cn"),
abbrev!("Christmas Island", "c,cx"),
abbrev!("Coc", "c,cc"),
abbrev!("Colombia", "c,co"),
abbrev!("Comoros", "c,km"),
abbrev!("Congo", "c,cg"),
abbrev!("Democratic Republic of the Congo", "c,cd"),
abbrev!("Cook Islands", "c,ck"),
abbrev!("Costa Rica", "c,cr"),
abbrev!("Ivory Coast", "c,ci"),
abbrev!("Croatia", "c,hr"),
abbrev!("Cuba", "c,cu"),
abbrev!("Cyprus", "c,cy"),
abbrev!("Czech Republic", "c,cz"),
abbrev!("Denmark", "c,dk"),
abbrev!("Djibouti", "c,dj"),
abbrev!("Dominica", "c,dm"),
abbrev!("Dominican Republic", "c,do"),
abbrev!("Ecuador", "c,ec"),
abbrev!("Egypt", "c,eg"),
abbrev!("El Salvador", "c,sv"),
abbrev!("Equatorial Guinea", "c,gq"),
abbrev!("Eritrea", "c,er"),
abbrev!("Estonia", "c,ee"),
abbrev!("Ethiopia", "c,et"),
abbrev!("Falkland Islands", "c,fk"),
abbrev!("Faroe Islands", "c,fo"),
abbrev!("Fiji", "c,fj"),
abbrev!("Finland", "c,fi"),
abbrev!("France", "c,fr"),
abbrev!("French Guiana", "c,gf"),
abbrev!("French Polynesia", "c,pf"),
abbrev!("French Southern Territories", "c,tf"),
abbrev!("Gabon", "c,ga"),
abbrev!("Gambia", "c,gm"),
abbrev!("Germany", "c,de"),
abbrev!("Ghana", "c,gh"),
abbrev!("Gibraltar", "c,gi"),
abbrev!("Greece", "c,gr"),
abbrev!("Greenland", "c,gl"),
abbrev!("Grenada", "c,gd"),
abbrev!("Guadeloupe", "c,gp"),
abbrev!("Guam", "c,gu"),
abbrev!("Guatemala", "c,gt"),
abbrev!("Guernsey", "c,gg"),
abbrev!("Guinea", "c,gn"),
abbrev!("Guyana", "c,gy"),
abbrev!("Haiti", "c,ht"),
abbrev!("Heard Island and McDonald Islands", "c,hm"),
abbrev!("Vatican City", "c,va"),
abbrev!("Honduras", "c,hn"),
abbrev!("Hong Kong", "c,hk"),
abbrev!("Hungary", "c,hu"),
abbrev!("Iceland", "c,is"),
abbrev!("India", "c,in"),
abbrev!("Indonesia", "c,id"),
abbrev!("Iran", "c,ir"),
abbrev!("Iraq", "c,iq"),
abbrev!("Ireland", "c,ie"),
abbrev!("Isle of Man", "c,im"),
abbrev!("Israel", "c,il"),
abbrev!("Italy", "c,it"),
abbrev!("Jamaica", "c,jm"),
abbrev!("Japan", "c,jp"),
abbrev!("Jersey", "c,je"),
abbrev!("Jordan", "c,jo"),
abbrev!("Kazakhstan", "c,kz"),
abbrev!("Kenya", "c,ke"),
abbrev!("Kiribati", "c,ki"),
abbrev!("Democratic People's Republic of Korea", "c,kp"),
abbrev!("South Korea", "c,kr"),
abbrev!("Kuwait", "c,kw"),
abbrev!("Kyrgyzstan", "c,kg"),
abbrev!("Laos", "c,la"),
abbrev!("Latvia", "c,lv"),
abbrev!("Lebanon", "c,lb"),
abbrev!("Lesotho", "c,ls"),
abbrev!("Liberia", "c,lr"),
abbrev!("Libya", "c,ly"),
abbrev!("Liechtenstein", "c,li"),
abbrev!("Lithuania", "c,lt"),
abbrev!("Luxembourg", "c,lu"),
abbrev!("Macao", "c,mo"),
abbrev!("Macedonia", "c,mk"),
abbrev!("Madagascar", "c,mg"),
abbrev!("Malawi", "c,mw"),
abbrev!("Malaysia", "c,my"),
abbrev!("Maldives", "c,mv"),
abbrev!("Mali", "c,ml"),
abbrev!("Malta", "c,mt"),
abbrev!("Marshall Islands", "c,mh"),
abbrev!("Martinique", "c,mq"),
abbrev!("Mauritania", "c,mr"),
abbrev!("Mauritius", "c,mu"),
abbrev!("Mayotte", "c,yt"),
abbrev!("Mexico", "c,mx"),
abbrev!("Micronesia", "c,fm"),
abbrev!("Moldova", "c,md"),
abbrev!("Monaco", "c,mc"),
abbrev!("Mongolia", "c,mn"),
abbrev!("Montenegro", "c,me"),
abbrev!("Montserrat", "c,ms"),
abbrev!("Morocco", "c,ma"),
abbrev!("Mozambique", "c,mz"),
abbrev!("Myanmar", "c,mm"),
abbrev!("Namibia", "c,na"),
abbrev!("Nauru", "c,nr"),
abbrev!("Nepal", "c,np"),
abbrev!("Netherlands", "c,nl"),
abbrev!("Netherlands Antilles", "c,an"),
abbrev!("New Caledonia", "c,nc"),
abbrev!("New Zealand", "c,nz"),
abbrev!("Nicaragua", "c,ni"),
abbrev!("Niger", "c,ne"),
abbrev!("Nigeria", "c,ng"),
abbrev!("Niue", "c,nu"),
abbrev!("Norfolk Island", "c,nf"),
abbrev!("Northern Mariana Islands", "c,mp"),
abbrev!("Norway", "c,no"),
abbrev!("Oman", "c,om"),
abbrev!("Pakistan", "c,pk"),
abbrev!("Palau", "c,pw"),
abbrev!("Palestinian Territory", "c,ps"),
abbrev!("Panama", "c,pa"),
abbrev!("Papua New Guinea", "c,pg"),
abbrev!("Paraguay", "c,py"),
abbrev!("Peru", "c,pe"),
abbrev!("Philippines", "c,ph"),
abbrev!("Pitcairn", "c,pn"),
abbrev!("Poland", "c,pl"),
abbrev!("Portugal", "c,pt"),
abbrev!("Puerto Rico", "c,pr"),
abbrev!("Qatar", "c,qa"),
abbrev!("Romania", "c,ro"),
abbrev!("Russia", "c,ru"),
abbrev!("Rwanda", "c,rw"),
abbrev!("Saint Kitts and Nevis", "c,kn"),
abbrev!("Saint Lucia", "c,lc"),
abbrev!("Saint Pierre and Miquelon", "c,pm"),
abbrev!("St Vincent and the Grenadines", "c,vc"),
abbrev!("Samoa", "c,ws"),
abbrev!("San Marino", "c,sm"),
abbrev!("Sao Tome and Principe", "c,st"),
abbrev!("Saudi Arabia", "c,sa"),
abbrev!("Senegal", "c,sn"),
abbrev!("Serbia", "c,rs"),
abbrev!("Seychelles", "c,sc"),
abbrev!("Sierra Leone", "c,sl"),
abbrev!("Singapore", "c,sg"),
abbrev!("Slovakia", "c,sk"),
abbrev!("Slovenia", "c,si"),
abbrev!("Solomon Islands", "c,sb"),
abbrev!("Somalia", "c,so"),
abbrev!("South Africa", "c,za"),
abbrev!("South Georgia and the South Sandwich Islands", "c,gs"),
abbrev!("South Sudan", "c,ss"),
abbrev!("Spain", "c,es"),
abbrev!("Sri Lanka", "c,lk"),
abbrev!("Sudan", "c,sd"),
abbrev!("Suriname", "c,sr"),
abbrev!("Svalbard and Jan Mayen", "c,sj"),
abbrev!("Swaziland", "c,sz"),
abbrev!("Sweden", "c,se"),
abbrev!("Switzerland", "c,ch"),
abbrev!("Syrian Arab Republic", "c,sy"),
abbrev!("Taiwan", "c,tw"),
abbrev!("Tajikistan", "c,tj"),
abbrev!("Tanzania", "c,tz"),
abbrev!("Thailand", "c,th"),
abbrev!("Togo", "c,tg"),
abbrev!("Tokelau", "c,tk"),
abbrev!("Tonga", "c,to"),
abbrev!("Trinidad and Tobago", "c,tt"),
abbrev!("Tunisia", "c,tn"),
abbrev!("Turkey", "c,tr"),
abbrev!("Turkmenistan", "c,tm"),
abbrev!("Turks and Caicos Islands", "c,tc"),
abbrev!("Tuvalu", "c,tv"),
abbrev!("Uganda", "c,ug"),
abbrev!("Ukraine", "c,ua"),
abbrev!("United Arab Emirates", "c,ae"),
abbrev!("United Kingdom", "c,gb"),
abbrev!("United States", "c,us"),
abbrev!("United States Minor Outlying Islands", "c,um"),
abbrev!("Uruguay", "c,uy"),
abbrev!("Uzbekistan", "c,uz"),
abbrev!("Vanuatu", "c,vu"),
abbrev!("Venezuela", "c,ve"),
abbrev!("Vietnam", "c,vn"),
abbrev!("British Virgin Islands", "c,vg"),
abbrev!("US Virgin Islands", "c,vi"),
abbrev!("Wallis and Futuna", "c,wf"),
abbrev!("Western Sahara", "c,eh"),
abbrev!("Yemen", "c,ye"),
abbrev!("Zambia", "c,zm"),
abbrev!("Zimbabwe", "c,zw"),
abbrev!("actinium", "e,ac"),
abbrev!("aluminum", "e,al"),
abbrev!("americium", "e,am"),
abbrev!("antimony", "e,sb"),
abbrev!("argon", "e,ar"),
abbrev!("arsenic", "e,as"),
abbrev!("astatine", "e,at"),
abbrev!("barium", "e,ba"),
abbrev!("berkelium", "e,bk"),
abbrev!("beryllium", "e,be"),
abbrev!("bismuth", "e,bi"),
abbrev!("bohrium", "e,bh"),
abbrev!("boron", "e,b"),
abbrev!("bromine", "e,br"),
abbrev!("cadmium", "e,cd"),
abbrev!("calcium", "e,ca"),
abbrev!("californium", "e,cf"),
abbrev!("carbon", "e,c"),
abbrev!("cerium", "e,ce"),
abbrev!("cesium", "e,cs"),
abbrev!("chlorine", "e,cl"),
abbrev!("chromium", "e,cr"),
abbrev!("cobalt", "e,co"),
abbrev!("copernicium", "e,cn"),
abbrev!("copper", "e,cu"),
abbrev!("curium", "e,cm"),
abbrev!("darmstadtium", "e,ds"),
abbrev!("dubnium", "e,db"),
abbrev!("dysprosium", "e,dy"),
abbrev!("einsteinium", "e,es"),
abbrev!("erbium", "e,er"),
abbrev!("europium", "e,eu"),
abbrev!("fermium", "e,fm"),
abbrev!("flerovium", "e,fl"),
abbrev!("fluorine", "e,f"),
abbrev!("francium", "e,fr"),
abbrev!("gadolinium", "e,gd"),
abbrev!("gallium", "e,ga"),
abbrev!("germanium", "e,ge"),
abbrev!("gold", "e,au"),
abbrev!("hafnium", "e,hf"),
abbrev!("hassium", "e,hs"),
abbrev!("helium", "e,he"),
abbrev!("holmium", "e,ho"),
abbrev!("hydrogen", "e,h"),
abbrev!("indium", "e,in"),
abbrev!("iodine", "e,i"),
abbrev!("iridium", "e,ir"),
abbrev!("iron", "e,fe"),
abbrev!("krypton", "e,kr"),
abbrev!("lanthanum", "e,la"),
abbrev!("lawrencium", "e,lr"),
abbrev!("lead", "e,pb"),
abbrev!("lithium", "e,li"),
abbrev!("livermorium", "e,lv"),
abbrev!("lutetium", "e,lu"),
abbrev!("magnesium", "e,mg"),
abbrev!("manganese", "e,mn"),
abbrev!("meitnerium", "e,mt"),
abbrev!("mendelevium", "e,md"),
abbrev!("mercury", "e,hg"),
abbrev!("molybdenum", "e,mo"),
abbrev!("moscovium", "e,mc"),
abbrev!("neodymium", "e,nd"),
abbrev!("neon", "e,ne"),
abbrev!("neptunium", "e,np"),
abbrev!("nickel", "e,ni"),
abbrev!("nihonium", "e,nh"),
abbrev!("niobium", "e,nb"),
abbrev!("nitrogen", "e,n"),
abbrev!("nobelium", "e,no"),
abbrev!("oganesson", "e,og"),
abbrev!("osmium", "e,os"),
abbrev!("oxygen", "e,o"),
abbrev!("palladium", "e,pd"),
abbrev!("phosphorus", "e,p"),
abbrev!("platinum", "e,pt"),
abbrev!("plutonium", "e,pu"),
abbrev!("polonium", "e,po"),
abbrev!("potassium", "e,k"),
abbrev!("praseodymium", "e,pr"),
abbrev!("promethium", "e,pm"),
abbrev!("protactinium", "e,pa"),
abbrev!("radium", "e,ra"),
abbrev!("radon", "e,rn"),
abbrev!("rhenium", "e,re"),
abbrev!("rhodium", "e,rh"),
abbrev!("roentgenium", "e,rg"),
abbrev!("rubidium", "e,rb"),
abbrev!("ruthenium", "e,ru"),
abbrev!("rutherfordium", "e,rf"),
abbrev!("samarium", "e,sm"),
abbrev!("scandium", "e,sc"),
abbrev!("seaborgium", "e,sg"),
abbrev!("selenium", "e,se"),
abbrev!("silicon", "e,si"),
abbrev!("silver", "e,ag"),
abbrev!("sodium", "e,na"),
abbrev!("strontium", "e,sr"),
abbrev!("sulfur", "e,s"),
abbrev!("tantalum", "e,ta"),
abbrev!("technetium", "e,tc"),
abbrev!("tellurium", "e,te"),
abbrev!("tennessine", "e,ts"),
abbrev!("terbium", "e,tb"),
abbrev!("thallium", "e,tl"),
abbrev!("thorium", "e,th"),
abbrev!("thulium", "e,tm"),
abbrev!("tin", "e,sn"),
abbrev!("titanium", "e,ti"),
abbrev!("uranium", "e,u"),
abbrev!("vanadium", "e,v"),
abbrev!("wolfram", "e,w"),
abbrev!("xenon", "e,xe"),
abbrev!("ytterbium", "e,yb"),
abbrev!("yttrium", "e,y"),
abbrev!("zinc", "e,zn"),
abbrev!("zirconium", "e,zr"),
abbrev!("National Basketball Association", "b,nba"),
abbrev!("Atlanta Hawks", "b,atl"),
abbrev!("Boston Celtics", "b,bos"),
abbrev!("Brooklyn Nets", "b,bkn"),
abbrev!("Charlotte Hornets", "b,cha"),
abbrev!("Chicago Bulls", "b,chi"),
abbrev!("Cleveland Cavaliers", "b,cle"),
abbrev!("Dallas Mavericks", "b,dal"),
abbrev!("Denver Nuggets", "b,den"),
abbrev!("Detroit Pistons", "b,det"),
abbrev!("Golden State Warriors", "b,gsw"),
abbrev!("Houston Rockets", "b,hou"),
abbrev!("Indiana Pacers", "b,ind"),
abbrev!("Los Angeles Clippers", "b,lac"),
abbrev!("Los Angeles Lakers", "b,lal"),
abbrev!("Memphis Grizzlies", "b,mem"),
abbrev!("Miami Heat", "b,mia"),
abbrev!("Milwaukee Bucks", "b,mil"),
abbrev!("Minnesota Timberwolves", "b,min"),
abbrev!("New Orleans Pelicans", "b,nop"),
abbrev!("New York Knicks", "b,nyk"),
abbrev!("Oklahoma City Thunder", "b,okc"),
abbrev!("Orlando Magic", "b,orl"),
abbrev!("Phoenix Suns", "b,phx"),
abbrev!("Portland Trail Blazers", "b,por"),
abbrev!("Sacramento Kings", "b,sac"),
abbrev!("San Antonio Spurs", "b,sas"),
abbrev!("Toronto Raptors", "b,tor"),
abbrev!("Utah Jazz", "b,uta"),
abbrev!("Washington Wizards", "b,was"),
];
#[cfg(test)]
mod test {
use std::collections::{BTreeSet, HashSet};
use expect_test::expect;
use crate::words::WORDS;
use super::ABBREVS;
#[test]
fn abbrevs_unique() {
for (i0, (long0, _, _)) in ABBREVS.iter().copied().enumerate() {
for (i, (long, _, _)) in ABBREVS.iter().copied().enumerate() {
if i0 == i {
continue;
}
assert_ne!(long0, long);
}
}
for (i0, (_, short0, _)) in ABBREVS.iter().copied().enumerate() {
for (i, (_, short, _)) in ABBREVS.iter().copied().enumerate() {
if i0 == i {
continue;
}
assert_ne!(short0, short);
}
}
}
#[test]
fn abbrevs_documented() {
const DOC: &str = include_str!("../../../doc/abbrevs.md");
let mut abbrevs = HashSet::with_capacity(ABBREVS.len());
for line in DOC.lines() {
if let [long, short] = line.split(" --> ").collect::<Vec<_>>().as_slice() {
abbrevs.insert((*long, *short));
}
}
for (long, short, _) in ABBREVS.iter().copied() {
if short.contains(',') {
continue;
}
assert!(
abbrevs.contains(&(long, short)),
"Should document {long} --> {short}"
);
}
}
#[test]
fn uncommon() {
const EXCEPTIONS: &[&str] = &[
"maximize",
"minimize",
"maximizing",
"minimizing",
"littlest",
];
for (long, short, _) in ABBREVS {
if long.contains('\'')
|| short.contains(',')
|| short.chars().any(|c| c.is_ascii_digit())
|| EXCEPTIONS.contains(long)
{
continue;
}
let word_sans_suffix = |suf| long.strip_suffix(suf).is_some_and(|l| WORDS.contains(&l));
assert!(
WORDS.contains(long)
|| ["ing", "'s", "s'", "es", "s", "er", "est", "ily", "ly"]
.iter()
.any(word_sans_suffix),
"'{long}' is not common enough to abbreviate"
);
}
}
#[test]
fn unused_letters() {
let mut letters = BTreeSet::from([
"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z",
]);
for (_, short, _) in ABBREVS.iter().copied() {
letters.remove(short);
}
let expected = expect!["gpz"];
expected.assert_eq(&letters.into_iter().collect::<Vec<_>>().join(""));
}
#[test]
fn unabbreviated() {
let mut words = WORDS[0..128].to_vec();
words.retain(|w| w.len() > 2);
for (long, _, _) in ABBREVS {
words.retain(|w| w != long);
}
let expected = expect![[r#"
with
what
she
all
there
had
who
out
has
their
like
when
more
said
did
get
him
time
them
some
now
which
think
than
our
here
well
new
then
see
back
these
going
its
even
way
where
want
got
years
make
any
most
say
does
those
come
many
take
may
says
why
work
still
look
too"#]];
expected.assert_eq(&words.into_iter().collect::<Vec<_>>().join("\n"));
}
}