Baseline: main branch state prior to Top-10 films expansion
This commit is contained in:
commit
6b15603e56
139 files changed
+329420
No files matched your search
+6
@@ -0,0 +1,6 @@
|
||||
// src/cmudict.js
|
||||
var cmudict = JSON.parse(`{"'bout":["B","AW1","T"],"'cause":["K","AH0","Z"],"'course":["K","AO1","R","S"],"'cuse":["K","Y","UW1","Z"],"'em":["AH0","M"],"'frisco":["F","R","IH1","S","K","OW0"],"'gain":["G","EH1","N"],"'kay":["K","EY1"],"'m":["AH0","M"],"'n":["AH0","N"],"'round":["R","AW1","N","D"],"'s":["EH1","S"],"'til":["T","IH1","L"],"'tis":["T","IH1","Z"],"'twas":["T","W","AH1","Z"],"a":["AH0"],"a's":["EY1","Z"],"a.":["EY1"],"a.'s":["EY1","Z"],"a.d.":["EY2","D","IY1"],"a.m.":["EY2","EH1","M"],"a.s":["EY1","Z"],"aaa":["T","R","IH2","P","AH0","L","EY1"],"aaberg":["AA1","B","ER0","G"],"aachen":["AA1","K","AH0","N"],"aachener":["AA1","K","AH0","N","ER0"],"aaker":["AA1","K","ER0"],"aalborg":["AO1","L","B","AO0","R","G","#","place,","danish"],"aalburg":["AE1","L","B","ER0","G","#","place,","dutch"],"aalen":["AE1","L","AH0","N","#","place,","german"],"aaliyah":["AA2","L","IY1","AA2"],"aalseth":["AA1","L","S","EH0","TH"],"aalsmeer":["AA1","L","S","M","IH0","R","#","place,","dutch"],"aalto":["AA1","L","T","OW2","#","name,","finnish"],"aamodt":["AA1","M","AH0","T"],"aancor":["AA1","NG","K","AO2","R"],"aardema":["AA0","R","D","EH1","M","AH0"],"aardvark":["AA1","R","D","V","AA2","R","K"],"aardvarks":["AA1","R","D","V","AA2","R","K","S"],"aargh":["AA1","R","G"],"aarhus":["AA2","HH","UW1","S"],"aaron":["EH1","R","AH0","N"],"aaron's":["EH1","R","AH0","N","Z"],"aarons":["EH1","R","AH0","N","Z"],"aaronson":["EH1","R","AH0","N","S","AH0","N"],"aaronson's":["EH1","R","AH0","N","S","AH0","N","Z"],"aarti":["AA1","R","T","IY2"],"aase":["AA1","S"],"aasen":["AA1","S","AH0","N"],"ab":["AE1","B"],"aba":["EY2","B","IY2","EY1"],"ababa":["AH0","B","AA1","B","AH0"],"abacha":["AE1","B","AH0","K","AH0"],"aback":["AH0","B","AE1","K"],"abaco":["AE1","B","AH0","K","OW2"],"abacus":["AE1","B","AH0","K","AH0","S"],"abad":["AH0","B","AA1","D"],"abadaka":["AH0","B","AE1","D","AH0","K","AH0"],"abadi":["AH0","B","AE1","D","IY0"],"abadie":["AH0","B","AE1","D","IY0"],"abair":["AH0","B","EH1","R"],"abalkin":["AH0","B","AA1","L","K","IH0","N"],"abalone":["AE2","B","AH0","L","OW1","N","IY0"],"abalones":["AE2","B","AH0","L","OW1","N","IY0","Z"],"abalos":["AA0","B","AA1","L","OW0","Z"],"abandon":["AH0","B","AE1","N","D","AH0","N"],"abandoned":["AH0","B","AE1","N","D","AH0","N","D"],"abandoning":["AH0","B","AE1","N","D","AH0","N","IH0","NG"],"abandonment":["AH0","B","AE1","N","D","AH0","N","M","AH0","N","T"],"abandonments":["AH0","B","AE1","N","D","AH0","N","M","AH0","N","T","S"],"abandons":["AH0","B","AE1","N","D","AH0","N","Z"],"abanto":["AH0","B","AE1","N","T","OW0"],"abarca":["AH0","B","AA1","R","K","AH0"],"abare":["AA0","B","AA1","R","IY0"],"abascal":["AE1","B","AH0","S","K","AH0","L"],"abash":["AH0","B","AE1","SH"],"abashed":["AH0","B","AE1","SH","T"],"abasia":["AH0","B","EY1","ZH","Y","AH0"],"abate":["AH0","B","EY1","T"],"abated":["AH0","B","EY1","T","IH0","D"],"abatement":["AH0","B","EY1","T","M","AH0","N","T"],"abatements":["AH0","B","EY1","T","M","AH0","N","T","S"],"abates":["AH0","B","EY1","T","S"],"abating":["AH0","B","EY1","T","IH0","NG"],"abattoir":["AE2","B","AH0","T","W","AA1","R"],"abba":["AE1","B","AH0"],"abbado":["AH0","B","AA1","D","OW0"],"abbas":["AH0","B","AA1","S"],"abbasi":["AA0","B","AA1","S","IY0"],"abbate":["AA1","B","EY0","T"],"abbatiello":["AA0","B","AA0","T","IY0","EH1","L","OW0"],"abbe":["AE1","B","IY0"],"abbenhaus":["AE1","B","AH0","N","HH","AW2","S"],"abbett":["AH0","B","EH1","T"],"abbeville":["AE1","B","V","IH0","L"],"abbey":["AE1","B","IY0"],"abbey's":["AE1","B","IY0","Z"],"abbie":["AE1","B","IY0"],"abbitt":["AE1","B","IH0","T"],"abbot":["AE1","B","AH0","T"],"abbotstown":["AE1","B","AH0","T","S","T","AW1","N"],"abbott":["AE1","B","AH0","T"],"abbott's":["AE1","B","AH0","T","S"],"abbottstown":["AE1","B","AH0","T","S","T","AW1","N"],"abboud":["AH0","B","UW1","D"],"abbreviate":["AH0","B","R","IY1","V","IY0","EY2","T"],"abbreviated":["AH0","B","R","IY1","V","IY0","EY2","T","IH0","D"],"abbreviates":["AH0","B","R","IY1","V","IY0","EY2","T","S"],"abbreviating":["AH0","B","R","IY1","V","IY0","EY2","T","IH0","NG"],"abbreviation":["AH0","B","R","IY2","V","IY0","EY1","SH","AH0","N"],"abbreviations":["AH0","B","R","IY2","V","IY0","EY1","SH","AH0","N","Z"],"abbruzzese":["AA0","B","R","UW0","T","S","EY1","Z","IY0"],"abbs":["AE1","B","Z"],"abby":["AE1","B","IY0"],"abc":["EY1","B","IY2","S","IY2"],"abc's":["EY1","B","IY2","S","IY2","Z"],"abco":["AE1","B","K","OW0"],"abcotek":["AE1","B","K","OW0","T","EH2","K"],"abcs":["EY1","B","IY2","S","IY2","Z"],"abd":["EY2","B","IY2","D","IY1"],"abdalla":["AE2","B","D","AE1","L","AH0"],"abdallah":["AE2","B","D","AE1","L","AH0"],"abdel":["AE1","B","D","EH2","L"],"abdella":["AE2","B","D","EH1","L","AH0"],"abdicate":["AE1","B","D","AH0","K","EY2","T"],"abdicated":["AE1","B","D","AH0","K","EY2","T","IH0","D"],"abdicates":["AE1","B","D","AH0","K","EY2","T","S"],"abdicating":["AE1","B","D","IH0","K","EY2","T","IH0","NG"],"abdication":["AE2","B","D","IH0","K","EY1","SH","AH0","N"],"abdnor":["AE1","B","D"
Line truncated
|
||||
var cmudict_default = cmudict;
|
||||
export {
|
||||
cmudict_default as default
|
||||
};
|
||||
+707
@@ -0,0 +1,707 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __esm = (fn, res) => function __init() {
|
||||
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/data/word-frequencies.js
|
||||
var word_frequencies_exports = {};
|
||||
__export(word_frequencies_exports, {
|
||||
default: () => word_frequencies_default
|
||||
});
|
||||
var WORD_FREQUENCIES, word_frequencies_default;
|
||||
var init_word_frequencies = __esm({
|
||||
"src/data/word-frequencies.js"() {
|
||||
"use strict";
|
||||
WORD_FREQUENCIES = JSON.parse(`{"you":2134713,"I":2038529,"the":1501908,"to":1156570,"s":1057301,"a":1041179,"it":963712,"t":733338,"that":719677,"and":682780,"of":590439,"What":501965,"in":498444,"me":471339,"is":459663,"we":459607,"this":406915,"he":389497,"on":354742,"for":351650,"my":344899,"m":343245,"your":328715,"don":321085,"have":314232,"do":312915,"re":311072,"No":304549,"be":293085,"know":291780,"was":288391,"not":276673,"can":267620,"are":265672,"all":263255,"with":257465,"just":242206,"get":233772,"here":230788,"but":225291,"ll":224097,"there":221754,"so":216452,"they":209250,"right":204428,"like":203947,"out":197131,"go":193445,"she":190377,"up":187170,"about":185206,"if":180610,"him":177710,"got":168631,"Oh":167781,"at":164072,"now":163333,"Come":160190,"one":156684,"How":155867,"Well":152523,"Yeah":152262,"her":144627,"want":140718,"think":137261,"good":133117,"see":130393,"Let":123381,"did":119410,"Why":114687,"who":113370,"as":113068,"his":108364,"will":108306,"going":108288,"from":103992,"when":103739,"back":102467,"Okay":102320,"Yes":101835,"gonna":101804,"d":101335,"time":99890,"look":99311,"take":96443,"an":95071,"man":94133,"Where":93341,"them":90720,"would":90162,"been":88573,"some":88089,"Hey":88079,"tell":87949,"or":86970,"us":86478,"had":85472,"were":84804,"say":83629,"could":83109,"didn":80623,"something":76508,"really":76508,"down":76004,"then":75966,"little":73766,"way":72661,"our":71425,"make":70775,"too":69950,"never":69490,"by":68364,"over":67488,"more":66228,"need":66040,"mean":63443,"very":63304,"off":60155,"Mr":60098,"sorry":59566,"give":59559,"has":57830,"Thank":56877,"love":56864,"said":56531,"am":56438,"people":56252,"please":56149,"sure":56091,"any":56068,"thing":55522,"only":55269,"because":54622,"two":54384,"should":54159,"doing":52492,"much":49636,"sir":49188,"Maybe":47249,"help":46977,"anything":46270,"these":46104,"God":46061,"even":44672,"night":44168,"call":43931,"talk":43605,"nothing":43534,"into":43074,"first":42869,"find":42379,"wait":42343,"put":42251,"great":41864,"thought":41232,"day":40893,"work":40699,"life":40629,"before":40501,"better":40494,"again":40428,"still":40225,"home":39491,"guy":38893,"won":38729,"those":38404,"than":37679,"around":37573,"other":37505,"away":37276,"new":36913,"last":36878,"uh":36579,"ever":36170,"stop":36071,"keep":35846,"told":35679,"must":35661,"things":35337,"big":34824,"after":34812,"long":34433,"does":34002,"always":33418,"their":33413,"everything":33399,"nice":33125,"name":32735,"money":32679,"doesn":32435,"guys":32198,"feel":31989,"believe":31882,"Thanks":31789,"old":31056,"place":30736,"fine":30502,"kind":30125,"isn":29886,"Hello":29857,"lot":29066,"years":29003,"made":28626,"leave":28596,"Hi":28464,"girl":28413,"hear":28323,"father":28279,"through":28026,"every":28007,"bad":27804,"Listen":27784,"remember":27666,"three":27654,"boy":27021,"coming":26878,"wrong":26678,"might":26334,"stay":26298,"house":26214,"may":26080,"baby":25978,"another":25970,"Ok":25928,"Dad":25870,"gotta":25852,"wanna":25796,"wanted":25616,"enough":25568,"talking":25385,"happened":24994,"show":24906,"course":24848,"being":24781,"care":24748,"done":24737,"getting":24719,"mind":24715,"left":24707,"ask":24640,"car":24636,"understand":24605,"mother":24476,"which":24339,"try":24314,"shit":24207,"hell":24012,"Miss":23850,"came":23650,"wouldn":23628,"own":23419,"world":23216,"guess":23153,"next":23090,"kill":23081,"else":22907,"dead":22898,"trying":22849,"someone":22752,"real":22583,"room":22415,"morning":22389,"huh":22350,"hold":22273,"ain":22248,"woman":22166,"yourself":22151,"today":22124,"looking":22066,"wasn":21984,"Mom":21950,"friend":21384,"move":21325,"same":21276,"job":21063,"tonight":21047,"went":20987,"son":20949,"best":20623,"saw":20527,"found":20196,"pretty":20003,"ready":19778,"heard":19775,"whole":19660,"seen":19633,"together":19553,"fuck":19307,"minute":19252,"men":19011,"head":18947,"matter":18900,"haven":18844,"knew":18817,"Excuse":18773,"many":18331,"idea":18311,"without":18087,"play":18081,"family":18067,"meet":17966,"most":17889,"run":17878,"while":17821,"wife":17795,"once":17589,"live":17574,"somebody":17571,"everybody":17555,"used":17551,"use":17536,"myself":17470,"took":17454,"yet":17428,"start":17345,"called":17341,"couldn":17336,"kid":17299,"tomorrow":17134,"happy":16993,"school":16989,"problem":16833,"watch":16831,"bring":16685,"fucking":16603,"actually":16439,"business":16371,"says":16356,"hope":16352,"open":16341,"already":16246,"since":16064,"looks":15886,"sit":15879,"Mrs":15858,"cause":15812,"alone":15735,"hard":15700,"wants":15655,"stuff":15653,"turn":15630,"days":15592,"friends":15578,"until":15426,"few":15393,"kids":15356,"honey":15325,"Dr":15194,"gone":15135,"both":15062,"door":14895,"later":14889,"saying":14874,"such":14852,"killed":14792,"having":14752,"face":14747,"worry":14638,"ago":14592,"five":14558,"second":14513,"brother":14481,"damn":14460,"case":14403,"thinking":14353,"probably":14323,"beautiful":14266,"
Line truncated
|
||||
word_frequencies_default = WORD_FREQUENCIES;
|
||||
}
|
||||
});
|
||||
|
||||
// src/cmudict.js
|
||||
var cmudict_exports = {};
|
||||
__export(cmudict_exports, {
|
||||
default: () => cmudict_default
|
||||
});
|
||||
var cmudict, cmudict_default;
|
||||
var init_cmudict = __esm({
|
||||
"src/cmudict.js"() {
|
||||
"use strict";
|
||||
cmudict = JSON.parse(`{"'bout":["B","AW1","T"],"'cause":["K","AH0","Z"],"'course":["K","AO1","R","S"],"'cuse":["K","Y","UW1","Z"],"'em":["AH0","M"],"'frisco":["F","R","IH1","S","K","OW0"],"'gain":["G","EH1","N"],"'kay":["K","EY1"],"'m":["AH0","M"],"'n":["AH0","N"],"'round":["R","AW1","N","D"],"'s":["EH1","S"],"'til":["T","IH1","L"],"'tis":["T","IH1","Z"],"'twas":["T","W","AH1","Z"],"a":["AH0"],"a's":["EY1","Z"],"a.":["EY1"],"a.'s":["EY1","Z"],"a.d.":["EY2","D","IY1"],"a.m.":["EY2","EH1","M"],"a.s":["EY1","Z"],"aaa":["T","R","IH2","P","AH0","L","EY1"],"aaberg":["AA1","B","ER0","G"],"aachen":["AA1","K","AH0","N"],"aachener":["AA1","K","AH0","N","ER0"],"aaker":["AA1","K","ER0"],"aalborg":["AO1","L","B","AO0","R","G","#","place,","danish"],"aalburg":["AE1","L","B","ER0","G","#","place,","dutch"],"aalen":["AE1","L","AH0","N","#","place,","german"],"aaliyah":["AA2","L","IY1","AA2"],"aalseth":["AA1","L","S","EH0","TH"],"aalsmeer":["AA1","L","S","M","IH0","R","#","place,","dutch"],"aalto":["AA1","L","T","OW2","#","name,","finnish"],"aamodt":["AA1","M","AH0","T"],"aancor":["AA1","NG","K","AO2","R"],"aardema":["AA0","R","D","EH1","M","AH0"],"aardvark":["AA1","R","D","V","AA2","R","K"],"aardvarks":["AA1","R","D","V","AA2","R","K","S"],"aargh":["AA1","R","G"],"aarhus":["AA2","HH","UW1","S"],"aaron":["EH1","R","AH0","N"],"aaron's":["EH1","R","AH0","N","Z"],"aarons":["EH1","R","AH0","N","Z"],"aaronson":["EH1","R","AH0","N","S","AH0","N"],"aaronson's":["EH1","R","AH0","N","S","AH0","N","Z"],"aarti":["AA1","R","T","IY2"],"aase":["AA1","S"],"aasen":["AA1","S","AH0","N"],"ab":["AE1","B"],"aba":["EY2","B","IY2","EY1"],"ababa":["AH0","B","AA1","B","AH0"],"abacha":["AE1","B","AH0","K","AH0"],"aback":["AH0","B","AE1","K"],"abaco":["AE1","B","AH0","K","OW2"],"abacus":["AE1","B","AH0","K","AH0","S"],"abad":["AH0","B","AA1","D"],"abadaka":["AH0","B","AE1","D","AH0","K","AH0"],"abadi":["AH0","B","AE1","D","IY0"],"abadie":["AH0","B","AE1","D","IY0"],"abair":["AH0","B","EH1","R"],"abalkin":["AH0","B","AA1","L","K","IH0","N"],"abalone":["AE2","B","AH0","L","OW1","N","IY0"],"abalones":["AE2","B","AH0","L","OW1","N","IY0","Z"],"abalos":["AA0","B","AA1","L","OW0","Z"],"abandon":["AH0","B","AE1","N","D","AH0","N"],"abandoned":["AH0","B","AE1","N","D","AH0","N","D"],"abandoning":["AH0","B","AE1","N","D","AH0","N","IH0","NG"],"abandonment":["AH0","B","AE1","N","D","AH0","N","M","AH0","N","T"],"abandonments":["AH0","B","AE1","N","D","AH0","N","M","AH0","N","T","S"],"abandons":["AH0","B","AE1","N","D","AH0","N","Z"],"abanto":["AH0","B","AE1","N","T","OW0"],"abarca":["AH0","B","AA1","R","K","AH0"],"abare":["AA0","B","AA1","R","IY0"],"abascal":["AE1","B","AH0","S","K","AH0","L"],"abash":["AH0","B","AE1","SH"],"abashed":["AH0","B","AE1","SH","T"],"abasia":["AH0","B","EY1","ZH","Y","AH0"],"abate":["AH0","B","EY1","T"],"abated":["AH0","B","EY1","T","IH0","D"],"abatement":["AH0","B","EY1","T","M","AH0","N","T"],"abatements":["AH0","B","EY1","T","M","AH0","N","T","S"],"abates":["AH0","B","EY1","T","S"],"abating":["AH0","B","EY1","T","IH0","NG"],"abattoir":["AE2","B","AH0","T","W","AA1","R"],"abba":["AE1","B","AH0"],"abbado":["AH0","B","AA1","D","OW0"],"abbas":["AH0","B","AA1","S"],"abbasi":["AA0","B","AA1","S","IY0"],"abbate":["AA1","B","EY0","T"],"abbatiello":["AA0","B","AA0","T","IY0","EH1","L","OW0"],"abbe":["AE1","B","IY0"],"abbenhaus":["AE1","B","AH0","N","HH","AW2","S"],"abbett":["AH0","B","EH1","T"],"abbeville":["AE1","B","V","IH0","L"],"abbey":["AE1","B","IY0"],"abbey's":["AE1","B","IY0","Z"],"abbie":["AE1","B","IY0"],"abbitt":["AE1","B","IH0","T"],"abbot":["AE1","B","AH0","T"],"abbotstown":["AE1","B","AH0","T","S","T","AW1","N"],"abbott":["AE1","B","AH0","T"],"abbott's":["AE1","B","AH0","T","S"],"abbottstown":["AE1","B","AH0","T","S","T","AW1","N"],"abboud":["AH0","B","UW1","D"],"abbreviate":["AH0","B","R","IY1","V","IY0","EY2","T"],"abbreviated":["AH0","B","R","IY1","V","IY0","EY2","T","IH0","D"],"abbreviates":["AH0","B","R","IY1","V","IY0","EY2","T","S"],"abbreviating":["AH0","B","R","IY1","V","IY0","EY2","T","IH0","NG"],"abbreviation":["AH0","B","R","IY2","V","IY0","EY1","SH","AH0","N"],"abbreviations":["AH0","B","R","IY2","V","IY0","EY1","SH","AH0","N","Z"],"abbruzzese":["AA0","B","R","UW0","T","S","EY1","Z","IY0"],"abbs":["AE1","B","Z"],"abby":["AE1","B","IY0"],"abc":["EY1","B","IY2","S","IY2"],"abc's":["EY1","B","IY2","S","IY2","Z"],"abco":["AE1","B","K","OW0"],"abcotek":["AE1","B","K","OW0","T","EH2","K"],"abcs":["EY1","B","IY2","S","IY2","Z"],"abd":["EY2","B","IY2","D","IY1"],"abdalla":["AE2","B","D","AE1","L","AH0"],"abdallah":["AE2","B","D","AE1","L","AH0"],"abdel":["AE1","B","D","EH2","L"],"abdella":["AE2","B","D","EH1","L","AH0"],"abdicate":["AE1","B","D","AH0","K","EY2","T"],"abdicated":["AE1","B","D","AH0","K","EY2","T","IH0","D"],"abdicates":["AE1","B","D","AH0","K","EY2","T","S"],"abdicating":["AE1","B","D","IH0","K","EY2","T","IH0","NG"],"abdication":["AE2","B","D","IH0","K","EY1","SH","AH0","N"],"abdnor":["AE1","B","D"
Line truncated
|
||||
cmudict_default = cmudict;
|
||||
}
|
||||
});
|
||||
|
||||
// src/reverse-cmudict.js
|
||||
var reverse_cmudict_exports = {};
|
||||
__export(reverse_cmudict_exports, {
|
||||
default: () => reverse_cmudict_default
|
||||
});
|
||||
var reverseCmudict, reverse_cmudict_default;
|
||||
var init_reverse_cmudict = __esm({
|
||||
"src/reverse-cmudict.js"() {
|
||||
"use strict";
|
||||
reverseCmudict = JSON.parse(`{"B AW T":["bout","'bout"],"K AH Z":["'cause"],"K AO R S":["course","coarse","corse","'course"],"K Y UW Z":["cues","ques","queues","q's","q.s","kuse","kuze","q.'s","'cuse"],"AH M":["um","umm","'m","'em"],"F R IH S K OW":["'frisco"],"G EH N":["'gain"],"K EY":["k","kay","cay","k.","khe","'kay","kaye","quaye"],"AH N":["un","'n"],"R AW N D":["round","'round"],"EH S":["s","es","esse","ess","'s","s."],"T IH L":["till","til","'til"],"T IH Z":["tis","'tis"],"T W AH Z":["twas","'twas"],"AH":["a","uh","uhh"],"EY Z":["a's","a.s","a.'s"],"EY":["ay","ae","a."],"EY D IY":["ady","a.d.","adey","eydie"],"EY EH M":["a.m."],"T R IH P AH L EY":["aaa"],"AA B ER G":["aaberg"],"AA K AH N":["aachen"],"AA K AH N ER":["aachener"],"AA K ER":["aaker","ocker"],"AO L B AO R G # place, danish":["aalborg"],"AE L B ER G # place, dutch":["aalburg"],"AE L AH N # place, german":["aalen"],"AA L IY AA":["aaliyah"],"AA L S EH TH":["aalseth"],"AA L S M IH R # place, dutch":["aalsmeer"],"AA L T OW # name, finnish":["aalto"],"AA M AH T":["aamodt"],"AA NG K AO R":["encore","oncor","aancor"],"AA R D EH M AH":["aardema"],"AA R D V AA R K":["aardvark"],"AA R D V AA R K S":["aardvarks"],"AA R G":["argh","aargh"],"AA HH UW S":["aarhus"],"EH R AH N":["aaron","aran","aron","ehren"],"EH R AH N Z":["arens","aarons","aaron's"],"EH R AH N S AH N":["aronson","aaronson"],"EH R AH N S AH N Z":["aaronson's"],"AA R T IY":["arty","aarti","artie"],"AA S":["os","aase"],"AA S AH N":["aasen","osten"],"AE B":["ab"],"EY B IY EY":["aba"],"AH B AA B AH":["ababa"],"AE B AH K AH":["abacha"],"AH B AE K":["aback"],"AE B AH K OW":["abaco"],"AE B AH K AH S":["abacus"],"AH B AA D":["abad"],"AH B AE D AH K AH":["abadaka"],"AH B AE D IY":["abadi","abadie"],"AH B EH R":["abair"],"AH B AA L K IH N":["abalkin"],"AE B AH L OW N IY":["abalone"],"AE B AH L OW N IY Z":["abalones"],"AA B AA L OW Z":["abalos"],"AH B AE N D AH N":["abandon"],"AH B AE N D AH N D":["abandoned"],"AH B AE N D AH N IH NG":["abandoning"],"AH B AE N D AH N M AH N T":["abandonment"],"AH B AE N D AH N M AH N T S":["abandonments"],"AH B AE N D AH N Z":["abandons"],"AH B AE N T OW":["abanto"],"AH B AA R K AH":["abarca"],"AA B AA R IY":["abare"],"AE B AH S K AH L":["abascal"],"AH B AE SH":["abash"],"AH B AE SH T":["abashed"],"AH B EY ZH Y AH":["abasia"],"AH B EY T":["abate"],"AH B EY T IH D":["abated"],"AH B EY T M AH N T":["abatement"],"AH B EY T M AH N T S":["abatements"],"AH B EY T S":["abates"],"AH B EY T IH NG":["abating"],"AE B AH T W AA R":["abattoir"],"AE B AH":["abba"],"AH B AA D OW":["abbado"],"AH B AA S":["abbas"],"AA B AA S IY":["abbasi"],"AA B EY T":["abbate"],"AA B AA T IY EH L OW":["abbatiello"],"AE B IY":["abby","abbey","abbe","abie","abbie"],"AE B AH N HH AW S":["abbenhaus"],"AH B EH T":["abet","abbett"],"AE B V IH L":["abbeville"],"AE B IY Z":["abbey's"],"AE B IH T":["abbitt"],"AE B AH T":["abbott","abbot"],"AE B AH T S T AW N":["abbotstown","abbottstown"],"AE B AH T S":["abbott's"],"AH B UW D":["abood","abboud"],"AH B R IY V IY EY T":["abbreviate"],"AH B R IY V IY EY T IH D":["abbreviated"],"AH B R IY V IY EY T S":["abbreviates"],"AH B R IY V IY EY T IH NG":["abbreviating"],"AH B R IY V IY EY SH AH N":["abbreviation"],"AH B R IY V IY EY SH AH N Z":["abbreviations"],"AA B R UW T S EY Z IY":["abruzzese","abbruzzese"],"AE B Z":["abbs"],"EY B IY S IY":["abc"],"EY B IY S IY Z":["abcs","abc's"],"AE B K OW":["abco"],"AE B K OW T EH K":["abcotek"],"EY B IY D IY":["abd"],"AE B D AE L AH":["abdalla","abdallah"],"AE B D EH L":["abdel"],"AE B D EH L AH":["abdella"],"AE B D AH K EY T":["abdicate"],"AE B D AH K EY T IH D":["abdicated"],"AE B D AH K EY T S":["abdicates"],"AE B D IH K EY T IH NG":["abdicating"],"AE B D IH K EY SH AH N":["abdication"],"AE B D N ER":["abdnor"],"AE B D OW":["abdo"],"AE B D AA L AH":["abdollah"],"AE B D OW M AH N":["abdomen"],"AE B D AA M AH N AH L":["abdominal"],"AE B D AH K T":["abduct"],"AE B D AH K T IH D":["abducted"],"AE B D AH K T IY":["abductee"],"AE B D AH K T IY Z":["abductees"],"AE B D AH K T IH NG":["abducting"],"AE B D AH K SH AH N":["abduction"],"AE B D AH K SH AH N Z":["abductions"],"AE B D AH K T ER":["abductor"],"AE B D AH K T ER Z":["abductors"],"AE B D AH K T S":["abducts"],"AE B D UW L":["abdul"],"AE B D UW L AH Z IY Z":["abdulaziz"],"AA B D UW L AH":["abdulla"],"AE B D AH L AH":["abdullah"],"EY B":["abe"],"AH B EH D":["abed"],"AH B EH D IY":["abedi"],"AH B IY":["abee"],"EY B AH L":["able","abel","abell"],"AA B EH L AH":["abela"],"AE B IH L ER D":["abelard"],"AH B EH L":["abele"],"AH B EH L Z":["abeles"],"AH B EH L AH":["abella"],"AE B IH L N":["abeln"],"AE B AH L OW":["abelow"],"EY B AH L Z":["abels","ables"],"AE B IH L S AH N":["abelson"],"AE B EH N D":["abend"],"AE B IH N D R AO TH":["abendroth"],"EY B ER":["aber","aybar"],"AE B ER K R AA M B IY":["abercrombie"],"AE B ER D IY N":["aberdeen"],"EY B ER F ER D":["aberford"],"AE B ER G":["aberg"],"AE B ER AH L":["aberle"],"AE B ER M IH N":["abermin"],"AE B ER N AE TH IY":["abernathy"],"
Line truncated
|
||||
reverse_cmudict_default = reverseCmudict;
|
||||
}
|
||||
});
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
CUSTOM_PRONUNCIATIONS: () => CUSTOM_PRONUNCIATIONS,
|
||||
getCustomPronunciation: () => getCustomPronunciation,
|
||||
getDictionary: () => getDictionary,
|
||||
getWordFrequency: () => getWordFrequency,
|
||||
hasCustomPronunciation: () => hasCustomPronunciation,
|
||||
isDictionaryLoaded: () => isDictionaryLoaded,
|
||||
loadDictionary: () => loadDictionary,
|
||||
loadFrequencies: () => loadFrequencies,
|
||||
loadReverseDictionary: () => loadReverseDictionary,
|
||||
lookupPhonemeKey: () => lookupPhonemeKey,
|
||||
lookupPronunciation: () => lookupPronunciation,
|
||||
lookupPronunciationLower: () => lookupPronunciationLower,
|
||||
sortByFrequency: () => sortByFrequency
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/custom-words.ts
|
||||
var CUSTOM_PRONUNCIATIONS = {
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — wrong consonant
|
||||
// ---------------------------------------------------------------------------
|
||||
abele: ["AH0", "B", "IY1", "L"],
|
||||
// /əˈbil/ — CMU has /ɛ/ for /i/
|
||||
abstention: ["AH0", "B", "S", "T", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /əbˈstɛnʃən/ — CMU has /tʃ/
|
||||
abstentions: ["AH0", "B", "S", "T", "EH1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /əbˈstɛnʃənz/ — CMU has /tʃ/
|
||||
actuator: ["AE1", "K", "CH", "UW0", "EY2", "T", "ER0"],
|
||||
// /ˈæktʃuˌeɪtɝ/ — CMU has /tj/
|
||||
actuators: ["AE1", "K", "CH", "UW0", "EY2", "T", "ER0", "Z"],
|
||||
// /ˈæktʃuˌeɪtɝz/ — CMU has /tj/
|
||||
africa: ["AE1", "F", "R", "IH0", "K", "AH0"],
|
||||
// /ˈæfrɪkə/ — CMU has /ə/ for /ɪ/ and /ɑ/ for /ə/
|
||||
alienate: ["EY1", "L", "IY0", "AH0", "N", "EY2", "T"],
|
||||
// /ˈeɪliəˌneɪt/ — CMU has /j/ for /i/
|
||||
// CMU has /s/ instead of /ʃ/ in -ciate/-ciation suffix
|
||||
associate: ["AH0", "S", "OW1", "SH", "IY0", "AH0", "T"],
|
||||
// /əˈsoʊʃiˌət/ — CMU has /s/
|
||||
associated: ["AH0", "S", "OW1", "SH", "IY0", "EY2", "T", "IH0", "D"],
|
||||
// /əˈsoʊʃiˌeɪtɪd/ — CMU has /s/
|
||||
associates: ["AH0", "S", "OW1", "SH", "IY0", "AH0", "T", "S"],
|
||||
// /əˈsoʊʃiˌəts/ — CMU has /s/
|
||||
associating: ["AH0", "S", "OW1", "SH", "IY0", "EY2", "T", "IH0", "NG"],
|
||||
// /əˈsoʊʃiˌeɪtɪŋ/ — CMU has /s/
|
||||
association: ["AH0", "S", "OW2", "SH", "IY0", "EY1", "SH", "AH0", "N"],
|
||||
// /əˌsoʊʃiˈeɪʃən/ — CMU has /s/
|
||||
associations: ["AH0", "S", "OW2", "SH", "IY0", "EY1", "SH", "AH0", "N", "Z"],
|
||||
// /əˌsoʊʃiˈeɪʃənz/ — CMU has /s/
|
||||
// Tech terms
|
||||
async: ["EY1", "S", "IH0", "NG", "K"],
|
||||
// /ˈeɪsɪŋk/
|
||||
blog: ["B", "L", "AO1", "G"],
|
||||
// /blɔɡ/
|
||||
bocce: ["B", "AA1", "CH", "IY0"],
|
||||
// /ˈbɑtʃi/ — CMU has /oʊ/ for /ɑ/
|
||||
// Foreign loanwords
|
||||
brulee: ["B", "R", "UW0", "L", "EY1"],
|
||||
// /bruˈleɪ/
|
||||
buffet: ["B", "AH0", "F", "EY1"],
|
||||
// /bʌˈfeɪ/ — CMU has verb "to strike", should be noun (food)
|
||||
// Linguistic terms missing from CMU
|
||||
camelcase: ["K", "AE1", "M", "AH0", "L", "K", "EY2", "S"],
|
||||
// /ˈkæməlˌkeɪs/ — G2P gives /eɪ/ for first vowel
|
||||
ceaselessly: ["S", "IY1", "S", "L", "AH0", "S", "L", "IY0"],
|
||||
// /ˈsisləsli/ — CMU has /z/
|
||||
// Irregular English words
|
||||
chamois: ["SH", "AE1", "M", "IY0"],
|
||||
// /ˈʃæmi/
|
||||
chatgpt: ["CH", "AE1", "T", "JH", "IY1", "P", "IY1", "T", "IY1"],
|
||||
// /tʃæt dʒi pi ti/
|
||||
cholmondeley: ["CH", "AH1", "M", "L", "IY0"],
|
||||
// /ˈtʃʌmli/
|
||||
circumflex: ["S", "ER1", "K", "AH0", "M", "F", "L", "EH2", "K", "S"],
|
||||
// /ˈsɜrkəmˌflɛks/ — G2P inserts vowel in fl cluster
|
||||
circumvention: ["S", "ER2", "K", "AH0", "M", "V", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ˌsɝkəmˈvɛnʃən/ — CMU has /tʃ/
|
||||
close: ["K", "L", "OW1", "Z"],
|
||||
// /kloʊz/ — CMU default is adjective /kloʊs/
|
||||
conscientiously: ["K", "AA2", "N", "SH", "IY0", "EH1", "N", "SH", "AH0", "S", "L", "IY0"],
|
||||
// /ˌkɑnʃiˈɛnʃəsli/ — CMU has /tʃ/
|
||||
contravention: ["K", "AA2", "N", "T", "R", "AH0", "V", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ˌkɑntrəˈvɛnʃən/ — CMU has /tʃ/
|
||||
convulsant: ["K", "AH0", "N", "V", "AH1", "L", "S", "AH0", "N", "T"],
|
||||
// /kənˈvʌlsənt/ — CMU missing /n/
|
||||
// Inconsistent vowel in derived form
|
||||
coughed: ["K", "AA1", "F", "T"],
|
||||
// /kɑft/ — CMU has /ɔ/ (AO), should match cough's /ɑ/ (AA)
|
||||
coughs: ["K", "AA1", "F", "S"],
|
||||
// /kɑfs/ — CMU has /ɔ/ (AO), should match cough's /ɑ/ (AA)
|
||||
cuckoo: ["K", "UW1", "K", "UW0"],
|
||||
// /ˈkuku/ — CMU has /ʌ/ for first vowel
|
||||
// Wrong vowel
|
||||
dedicate: ["D", "EH1", "D", "IH0", "K", "EY2", "T"],
|
||||
// /ˈdɛdɪˌkeɪt/ — CMU has /ə/ for /ɪ/
|
||||
dedicated: ["D", "EH1", "D", "IH0", "K", "EY0", "T", "IH0", "D"],
|
||||
// /ˈdɛdɪkeɪtɪd/ — CMU has /ə/ for /ɪ/
|
||||
dedication: ["D", "EH2", "D", "IH0", "K", "EY1", "SH", "AH0", "N"],
|
||||
// /ˌdɛdɪˈkeɪʃən/ — CMU has /ə/ for /ɪ/
|
||||
// Wrong consonant in derived form
|
||||
deliciously: ["D", "IH0", "L", "IH1", "SH", "AH0", "S", "L", "IY0"],
|
||||
// /dɪˈlɪʃəsli/ — CMU has /ʃ/ for final /s/
|
||||
derivational: ["D", "EH2", "R", "IH0", "V", "EY1", "SH", "AH0", "N", "AH0", "L"],
|
||||
// /ˌdɛrɪˈveɪʃənəl/ — G2P gives /aɪ/ for first vowel
|
||||
// Website/tech terms missing from CMU
|
||||
digraph: ["D", "AY1", "G", "R", "AE2", "F"],
|
||||
// /ˈdaɪˌɡræf/ — G2P gives short /ɪ/
|
||||
digraphs: ["D", "AY1", "G", "R", "AE2", "F", "S"],
|
||||
// /ˈdaɪˌɡræfs/
|
||||
// Wrong syllable count
|
||||
doer: ["D", "UW1", "ER0"],
|
||||
// /ˈduɝ/ — CMU has 1 syllable (D UW1 R), should be 2 like doers
|
||||
doppelganger: ["D", "AA1", "P", "AH0", "L", "G", "AE2", "NG", "ER0"],
|
||||
// /ˈdɑpəlˌɡæŋɝ/
|
||||
drachm: ["D", "R", "AE1", "M"],
|
||||
// /dræm/ — silent ch
|
||||
// Spurious /j/ glide (British /juː/ where AmE uses /uː/)
|
||||
dudes: ["D", "UW1", "D", "Z"],
|
||||
// /duːdz/ — CMU has /dju/, should match dude's /du/
|
||||
duplicates: ["D", "UW1", "P", "L", "AH0", "K", "EY2", "T", "S"],
|
||||
// /ˈdupləˌkeɪts/ — CMU has /dju/
|
||||
duplication: ["D", "UW2", "P", "L", "AH0", "K", "EY1", "SH", "AH0", "N"],
|
||||
// /ˌdupləˈkeɪʃən/ — CMU has /dju/
|
||||
emoji: ["IH0", "M", "OW1", "JH", "IY0"],
|
||||
// /ɪˈmoʊdʒi/
|
||||
engenders: ["EH0", "N", "JH", "EH1", "N", "D", "ER0", "Z"],
|
||||
// /ɛnˈdʒɛndɝz/ — CMU has /ŋɡ/
|
||||
excruciatingly: [
|
||||
"EH2",
|
||||
"K",
|
||||
"S",
|
||||
"K",
|
||||
"R",
|
||||
"UW1",
|
||||
"SH",
|
||||
"IY0",
|
||||
"EY2",
|
||||
"T",
|
||||
"IH0",
|
||||
"NG",
|
||||
"L",
|
||||
"IY0"
|
||||
],
|
||||
// /ɪkˈskruʃiˌeɪtɪŋli/ — CMU has /s/ (excruciating is correct)
|
||||
expos\u00E9: ["EH2", "K", "S", "P", "OW0", "Z", "EY1"],
|
||||
// /ˌɛkspoʊˈzeɪ/ — French noun (report), not verb "to expose"
|
||||
favicon: ["F", "AE1", "V", "IH0", "K", "AA2", "N"],
|
||||
// /ˈfævɪˌkɑn/ — "favorite icon"
|
||||
fiancee: ["F", "IY0", "AA0", "N", "S", "EY1"],
|
||||
// /fiɑnˈseɪ/ — CMU has wrong final syllable
|
||||
finagle: ["F", "IH0", "N", "EY1", "G", "AH0", "L"],
|
||||
// /fɪˈneɪɡəl/ — CMU has /ə/ for /eɪ/, wrong stress
|
||||
flambe: ["F", "L", "AA0", "M", "B", "EY1"],
|
||||
// /flɑmˈbeɪ/
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — wrong vowel or glide
|
||||
// ---------------------------------------------------------------------------
|
||||
// Missing phoneme
|
||||
forgings: ["F", "AO1", "R", "JH", "IH0", "NG", "Z"],
|
||||
// /ˈfɔrdʒɪŋz/ — CMU missing /r/
|
||||
fraudulently: ["F", "R", "AO1", "JH", "AH0", "L", "AH0", "N", "T", "L", "IY0"],
|
||||
// /ˈfrɔdʒələntli/ — CMU has /d/
|
||||
// Days of the week: CMU v1 has /i/ but standard AmE uses /eɪ/
|
||||
friday: ["F", "R", "AY1", "D", "EY2"],
|
||||
// /ˈfraɪˌdeɪ/
|
||||
gestalt: ["G", "AH0", "SH", "T", "AA1", "L", "T"],
|
||||
// /ɡəˈʃtɑlt/
|
||||
github: ["G", "IH1", "T", "HH", "AH1", "B"],
|
||||
// /ˈɡɪtˌhʌb/
|
||||
grandma: ["G", "R", "AE1", "N", "M", "AA2"],
|
||||
// /ˈɡrænˌmɑ/ — CMU has spurious /d/
|
||||
haphazardly: ["HH", "AE0", "P", "HH", "AE1", "Z", "ER0", "D", "L", "IY0"],
|
||||
// /hæpˈhæzɝdli/ — CMU has /f/
|
||||
headquartered: ["HH", "EH1", "D", "K", "W", "AO2", "R", "T", "ER0", "D"],
|
||||
// /ˈhɛdˌkwɔrtɝd/ — CMU missing /w/
|
||||
hors: ["AO1", "R"],
|
||||
// /ɔr/ — CMU wrong; French: silent h and s (hors d'oeuvres)
|
||||
iframe: ["AY1", "F", "R", "EY2", "M"],
|
||||
// /ˈaɪˌfreɪm/ — G2P gives short /ɪ/ for "i"
|
||||
immature: ["IH2", "M", "AH0", "CH", "UH1", "R"],
|
||||
// /ˌɪməˈtʃʊr/ — CMU has /tj/ (British), should match mature's /tʃ/
|
||||
inattention: ["IH2", "N", "AH0", "T", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ˌɪnəˈtɛnʃən/ — CMU has /tʃ/
|
||||
// N→NG + additional vowel fix (N→NG alone handled by normalizeVelarNasal)
|
||||
inconclusively: ["IH2", "NG", "K", "AH0", "NG", "K", "L", "UW1", "S", "IH0", "V", "L", "IY0"],
|
||||
// /ˌɪŋkəŋˈklusɪvli/ — CMU has /nk/
|
||||
initialisms: ["IH0", "N", "IH1", "SH", "AH0", "L", "IH2", "Z", "AH0", "M", "Z"],
|
||||
// /ɪˈnɪʃəˌlɪzəmz/
|
||||
// CMU has /tʃ/ instead of /ʃ/ in -tion/-sion suffix after N
|
||||
intention: ["IH0", "N", "T", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ɪnˈtɛnʃən/ — CMU has /tʃ/
|
||||
intentions: ["IH0", "N", "T", "EH1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /ɪnˈtɛnʃənz/ — CMU has /tʃ/
|
||||
islington: ["IH1", "Z", "L", "IH0", "NG", "T", "AH0", "N"],
|
||||
// /ˈɪzlɪŋtən/
|
||||
lead: ["L", "IY1", "D"],
|
||||
// /liːd/ — CMU default is metal /lɛd/
|
||||
legalese: ["L", "IY2", "G", "AH0", "L", "IY1", "Z"],
|
||||
// /ˌliɡəˈliz/ — CMU has /ɛ/, /s/, wrong stress
|
||||
legit: ["L", "AH0", "JH", "IH1", "T"],
|
||||
// /ləˈdʒɪt/ — CMU has /ɛ/ and wrong stress
|
||||
leisure: ["L", "IY1", "ZH", "ER0"],
|
||||
// /ˈliʒɝ/ — CMU has British /ɛ/, AmE is /i/
|
||||
leniently: ["L", "IY1", "N", "IY0", "AH0", "N", "T", "L", "IY0"],
|
||||
// /ˈliniəntli/ — CMU has /j/ for /i/
|
||||
live: ["L", "IH1", "V"],
|
||||
// /lɪv/ — CMU default is adjective /laɪv/
|
||||
localhost: ["L", "OW1", "K", "AH0", "L", "HH", "OW2", "S", "T"],
|
||||
// /ˈloʊkəlˌhoʊst/
|
||||
manana: ["M", "AE0", "N", "Y", "AA1", "N", "AH0"],
|
||||
// /mænˈjɑnə/
|
||||
mansions: ["M", "AE1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /ˈmænʃənz/ — CMU has /tʃ/ (singular is correct)
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — wrong word sense or incomplete entry
|
||||
// ---------------------------------------------------------------------------
|
||||
matured: ["M", "AH0", "CH", "UH1", "R", "D"],
|
||||
// /məˈtʃʊrd/ — CMU has /tj/ (British), should match mature's /tʃ/
|
||||
monday: ["M", "AH1", "N", "D", "EY2"],
|
||||
// /ˈmʌnˌdeɪ/
|
||||
navbar: ["N", "AE1", "V", "B", "AA2", "R"],
|
||||
// /ˈnævˌbɑr/ — "navigation bar"; G2P gives /ɚ/ for second vowel
|
||||
negligee: ["N", "EH1", "G", "L", "AH0", "ZH", "EY2"],
|
||||
// /ˈnɛɡləˌʒeɪ/
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — variant ordering (v1 wrong for standard AmE)
|
||||
// ---------------------------------------------------------------------------
|
||||
nemo: ["N", "IY1", "M", "OW0"],
|
||||
// /ˈnimoʊ/ — CMU has /ɛ/ for /i/
|
||||
npm: ["EH1", "N", "P", "IY1", "EH1", "M"],
|
||||
// /ɛn pi ɛm/
|
||||
oauth: ["OW1", "AO1", "TH"],
|
||||
// /oʊɔθ/
|
||||
obsequies: ["AA1", "B", "S", "IH0", "K", "W", "IY0", "Z"],
|
||||
// /ˈɑbsɪkwiz/
|
||||
oppugnant: ["AH0", "P", "AH1", "G", "N", "AH0", "N", "T"],
|
||||
// /əˈpʌɡnənt/
|
||||
oppugners: ["AH0", "P", "Y", "UW1", "N", "ER0", "Z"],
|
||||
// /əˈpjunɝz/ — silent g
|
||||
orthographic: ["AO2", "R", "TH", "AH0", "G", "R", "AE1", "F", "IH0", "K"],
|
||||
// /ˌɔrθəˈɡræfɪk/
|
||||
ow: ["AW1"],
|
||||
// /aʊ/ — CMU has /oʊ/
|
||||
padre: ["P", "AA1", "D", "R", "EY0"],
|
||||
// /ˈpɑdreɪ/ — CMU has /æ/ for /ɑ/
|
||||
parameterized: ["P", "ER0", "AE1", "M", "IH0", "T", "ER0", "AY2", "Z", "D"],
|
||||
// /pəˈræmɪtəˌraɪzd/ — G2P gives /eɪ/ for first syllable
|
||||
patisserie: ["P", "AH0", "T", "IH1", "S", "ER0", "IY0"],
|
||||
// /pəˈtɪsɝi/
|
||||
permalink: ["P", "ER1", "M", "AH0", "L", "IH2", "NG", "K"],
|
||||
// /ˈpɝməˌlɪŋk/ — "permanent link"
|
||||
phaeton: ["F", "EY1", "IH0", "T", "AH0", "N"],
|
||||
// /ˈfeɪɪtən/
|
||||
pinata: ["P", "IH0", "N", "Y", "AA1", "T", "AH0"],
|
||||
// /pɪnˈjɑtə/
|
||||
piquet: ["P", "IH0", "K", "EY1"],
|
||||
// /pɪˈkeɪ/
|
||||
// ---------------------------------------------------------------------------
|
||||
// Additions — words not in CMU dictionary
|
||||
// ---------------------------------------------------------------------------
|
||||
placeholder: ["P", "L", "EY1", "S", "HH", "OW2", "L", "D", "ER0"],
|
||||
// /ˈpleɪsˌhoʊldɝ/
|
||||
podcast: ["P", "AA1", "D", "K", "AE2", "S", "T"],
|
||||
// /ˈpɑdˌkæst/
|
||||
potshots: ["P", "AA1", "SH", "AA2", "T", "S"],
|
||||
// /ˈpɑtˌʃɑts/ — CMU has /tʃ/, should match potshot's /ʃ/
|
||||
president: ["P", "R", "EH1", "Z", "IH0", "D", "AH0", "N", "T"],
|
||||
// /ˈprɛzɪdənt/ — CMU has /ə/ for /ɪ/ and /ɛ/ for /ə/
|
||||
// Voicing errors (/s/↔/z/, /θ/↔/ð/)
|
||||
presidentially: ["P", "R", "EH2", "Z", "IH0", "D", "EH1", "N", "SH", "AH0", "L", "IY0"],
|
||||
// /ˌprɛzɪˈdɛnʃəli/ — CMU has /s/
|
||||
privatize: ["P", "R", "AY1", "V", "AH0", "T", "AY2", "Z"],
|
||||
// /ˈpraɪvəˌtaɪz/ — CMU has /ɪ/ for /aɪ/, should match private
|
||||
// Silent letter pronounced
|
||||
psalm: ["S", "AA1", "M"],
|
||||
// /sɑm/ — CMU has /l/, but L is silent in psalm
|
||||
psalms: ["S", "AA1", "M", "Z"],
|
||||
// /sɑmz/ — CMU has /l/, but L is silent in psalm
|
||||
puisne: ["P", "Y", "UW1", "N", "IY0"],
|
||||
// /ˈpjuni/
|
||||
// Homographs: CMU default is the less common sense
|
||||
read: ["R", "IY1", "D"],
|
||||
// /riːd/ — CMU default is past tense /rɛd/
|
||||
record: ["R", "EH1", "K", "ER0", "D"],
|
||||
// /ˈrɛkɝd/ — CMU default is verb /rɪˈkɔrd/
|
||||
rededicate: ["R", "IY2", "D", "EH1", "D", "IH0", "K", "EY2", "T"],
|
||||
// /ˌriˈdɛdɪˌkeɪt/ — CMU has /ə/ for /ɪ/
|
||||
rededication: ["R", "IY0", "D", "EH2", "D", "IH0", "K", "EY1", "SH", "AH0", "N"],
|
||||
// /riˌdɛdɪˈkeɪʃən/ — CMU has /ə/ for /ɪ/
|
||||
regex: ["R", "EH1", "JH", "EH0", "K", "S"],
|
||||
// /ˈrɛdʒɛks/ — G2P gives /iː/ for first vowel
|
||||
reschedulings: ["R", "IY0", "S", "K", "EH1", "JH", "UW0", "L", "IH0", "NG", "Z"],
|
||||
// /riˈskɛdʒulɪŋz/ — CMU has /ʃ/ (British)
|
||||
resolutely: ["R", "EH1", "Z", "AH0", "L", "UW2", "T", "L", "IY0"],
|
||||
// /ˈrɛzəˌlutli/ — CMU has /s/
|
||||
// Accented homographs: diacritics signal a different word than CMU's default
|
||||
r\u00E9sum\u00E9: ["R", "EH1", "Z", "AH0", "M", "EY2"],
|
||||
// /ˈrɛzəˌmeɪ/ — French noun (CV), not verb "to resume"
|
||||
retroflex: ["R", "EH1", "T", "R", "OW0", "F", "L", "EH2", "K", "S"],
|
||||
// /ˈrɛtroʊˌflɛks/ — G2P gives /iː/ + epenthetic vowel in fl
|
||||
revaluations: ["R", "IY0", "V", "AE2", "L", "Y", "UW0", "EY1", "SH", "AH0", "N", "Z"],
|
||||
// /riˌvæljueɪʃənz/ — CMU has extra /ɪ/
|
||||
roommate: ["R", "UW1", "M", "M", "EY2", "T"],
|
||||
// /ˈrumˌmeɪt/ — CMU missing geminate /mm/
|
||||
roommates: ["R", "UW1", "M", "M", "EY2", "T", "S"],
|
||||
// /ˈrumˌmeɪts/ — CMU missing geminate /mm/
|
||||
saturday: ["S", "AE1", "T", "ER0", "D", "EY2"],
|
||||
// /ˈsætɝˌdeɪ/
|
||||
soupcon: ["S", "UW0", "P", "S", "AA1", "N"],
|
||||
// /supˈsɑn/
|
||||
streatham: ["S", "T", "R", "EH1", "T", "AH0", "M"],
|
||||
// /ˈstrɛtəm/
|
||||
syllabification: ["S", "IH0", "L", "AE1", "B", "IH0", "F", "IH0", "K", "EY2", "SH", "AH0", "N"],
|
||||
// /sɪˌlæbɪfɪˈkeɪʃən/ — G2P drops /b/
|
||||
temptation: ["T", "EH0", "M", "P", "T", "EY1", "SH", "AH0", "N"],
|
||||
// /tɛmpˈteɪʃən/ — CMU missing /p/
|
||||
temptations: ["T", "EH0", "M", "P", "T", "EY1", "SH", "AH0", "N", "Z"],
|
||||
// /tɛmpˈteɪʃənz/ — CMU missing /p/
|
||||
tensions: ["T", "EH1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /ˈtɛnʃənz/ — CMU has /tʃ/ (singular is correct)
|
||||
terpsichore: ["T", "ER0", "P", "S", "IH1", "K", "ER0", "IY0"],
|
||||
// /tɝpˈsɪkɝi/
|
||||
// Missing contracted "is" — "this'" = "this is", needs epenthetic /əz/ since base ends in /s/
|
||||
"this'": ["DH", "IH1", "S", "AH0", "Z"],
|
||||
// /ðɪsəz/ — CMU has /ðɪs/ (same as "this", missing "is")
|
||||
thyme: ["T", "AY1", "M"],
|
||||
// /taɪm/ — CMU has /θ/, but h is silent
|
||||
touche: ["T", "UW0", "SH", "EY1"],
|
||||
// /tuˈʃeɪ/ — CMU missing final syllable
|
||||
transliteration: ["T", "R", "AE2", "N", "Z", "L", "IH0", "T", "ER0", "EY1", "SH", "AH0", "N"],
|
||||
// /ˌtrænzlɪtəˈreɪʃən/
|
||||
tuesday: ["T", "UW1", "Z", "D", "EY2"],
|
||||
// /ˈtuzˌdeɪ/
|
||||
tuition: ["T", "UW0", "IH1", "SH", "AH0", "N"],
|
||||
// /tuˈɪʃən/ — CMU has /tju/
|
||||
unknowns: ["AH0", "N", "N", "OW1", "N", "Z"],
|
||||
// /ənˈnoʊnz/ — CMU missing second /n/
|
||||
use: ["Y", "UW1", "Z"],
|
||||
// /juːz/ — CMU default is noun /juːs/
|
||||
valium: ["V", "AE1", "L", "IY0", "AH0", "M"],
|
||||
// /ˈvæliəm/ — CMU has /eɪ/ for /æ/
|
||||
velar: ["V", "IY1", "L", "ER0"],
|
||||
// /ˈviːlɚ/ — G2P gives short /ɛ/ for first vowel
|
||||
victual: ["V", "IH1", "T", "AH0", "L"],
|
||||
// /ˈvɪtəl/ — silent c
|
||||
victuals: ["V", "IH1", "T", "AH0", "L", "Z"],
|
||||
// /ˈvɪtəlz/ — silent c
|
||||
vlog: ["V", "L", "AO1", "G"],
|
||||
// /vlɔɡ/
|
||||
// Abbreviations
|
||||
vs: ["V", "ER1", "S", "AH0", "S"],
|
||||
// /ˈvɝsəs/
|
||||
webpack: ["W", "EH1", "B", "P", "AE1", "K"],
|
||||
// /ˈwɛbˌpæk/
|
||||
wednesday: ["W", "EH1", "N", "Z", "D", "EY2"],
|
||||
// /ˈwɛnzˌdeɪ/
|
||||
"well-doer": ["W", "EH1", "L", "D", "UW1", "ER0"],
|
||||
// /ˈwɛlˌduɝ/ — CMU has 1-syllable doer
|
||||
wind: ["W", "IH1", "N", "D"],
|
||||
// /wɪnd/ — CMU default is verb /waɪnd/
|
||||
withdrawals: ["W", "IH0", "DH", "D", "R", "AO1", "AH0", "L", "Z"],
|
||||
// /wɪðˈdrɔəlz/ — CMU has /θ/
|
||||
withdrawing: ["W", "IH0", "DH", "D", "R", "AO1", "IH0", "NG"],
|
||||
// /wɪðˈdrɔɪŋ/ — CMU has /θ/
|
||||
withdrawn: ["W", "IH0", "DH", "D", "R", "AO1", "N"]
|
||||
// /wɪðˈdrɔn/ — CMU has /θ/
|
||||
};
|
||||
var CUSTOM_MAP = new Map(Object.entries(CUSTOM_PRONUNCIATIONS));
|
||||
function getCustomPronunciation(word) {
|
||||
return CUSTOM_MAP.get(word);
|
||||
}
|
||||
function hasCustomPronunciation(word) {
|
||||
return CUSTOM_MAP.has(word);
|
||||
}
|
||||
|
||||
// src/lazy-loader.ts
|
||||
function createLazyLoader(loadFn, errorLabel) {
|
||||
let data = null;
|
||||
let promise = null;
|
||||
return {
|
||||
get() {
|
||||
if (data === null) {
|
||||
throw new Error(`${errorLabel} not loaded. Call load() first.`);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
isLoaded() {
|
||||
return data !== null;
|
||||
},
|
||||
load() {
|
||||
if (data !== null) {
|
||||
return Promise.resolve(data);
|
||||
}
|
||||
if (promise !== null) {
|
||||
return promise;
|
||||
}
|
||||
promise = loadFn().then((result) => {
|
||||
data = result;
|
||||
return data;
|
||||
}).catch((error) => {
|
||||
promise = null;
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
throw new Error(`Failed to load ${errorLabel}: ${message}`);
|
||||
});
|
||||
return promise;
|
||||
},
|
||||
reset() {
|
||||
data = null;
|
||||
promise = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// src/load-json.ts
|
||||
var import_meta = {};
|
||||
async function loadJson(basename) {
|
||||
if (typeof process === "undefined" || !process.versions?.node) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const { readFileSync } = await import("fs");
|
||||
const { fileURLToPath } = await import("url");
|
||||
const thisFile = fileURLToPath(import_meta.url);
|
||||
const dir = thisFile.slice(0, thisFile.lastIndexOf("/"));
|
||||
return JSON.parse(readFileSync(`${dir}/${basename}.json`, "utf8"));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// src/frequency.ts
|
||||
var loader = createLazyLoader(async () => {
|
||||
const json = await loadJson("data/word-frequencies");
|
||||
let raw;
|
||||
if (json === null) {
|
||||
const mod = await Promise.resolve().then(() => (init_word_frequencies(), word_frequencies_exports));
|
||||
raw = mod.default;
|
||||
} else {
|
||||
raw = json;
|
||||
}
|
||||
const map = /* @__PURE__ */ new Map();
|
||||
for (const [word, count] of Object.entries(raw)) {
|
||||
map.set(word.toLowerCase(), count);
|
||||
}
|
||||
return { map, raw };
|
||||
}, "word frequencies");
|
||||
function getWordFrequency(word) {
|
||||
if (!loader.isLoaded()) {
|
||||
return void 0;
|
||||
}
|
||||
return loader.get().map.get(word.toLowerCase());
|
||||
}
|
||||
async function loadFrequencies() {
|
||||
const data = await loader.load();
|
||||
return data.raw;
|
||||
}
|
||||
var COMMON_CONTRACTIONS = /* @__PURE__ */ new Set([
|
||||
"ain't",
|
||||
"aren't",
|
||||
// n't contractions
|
||||
"can't",
|
||||
"could've",
|
||||
"couldn't",
|
||||
"didn't",
|
||||
"doesn't",
|
||||
"don't",
|
||||
"hadn't",
|
||||
"hasn't",
|
||||
"haven't",
|
||||
"he'd",
|
||||
"he'll",
|
||||
// 's contractions (is/has)
|
||||
"he's",
|
||||
"here's",
|
||||
"how's",
|
||||
// 'd contractions
|
||||
"i'd",
|
||||
// 'll contractions
|
||||
"i'll",
|
||||
// 'm contractions
|
||||
"i'm",
|
||||
// 've contractions
|
||||
"i've",
|
||||
"isn't",
|
||||
"it'd",
|
||||
"it'll",
|
||||
"it's",
|
||||
"let's",
|
||||
"might've",
|
||||
"mightn't",
|
||||
"must've",
|
||||
"mustn't",
|
||||
"needn't",
|
||||
"shan't",
|
||||
"she'd",
|
||||
"she'll",
|
||||
"she's",
|
||||
"should've",
|
||||
"shouldn't",
|
||||
"that'd",
|
||||
"that'll",
|
||||
"that's",
|
||||
"there'll",
|
||||
"there's",
|
||||
"they'd",
|
||||
"they'll",
|
||||
"they're",
|
||||
"they've",
|
||||
"wasn't",
|
||||
"we'd",
|
||||
"we'll",
|
||||
"we're",
|
||||
"we've",
|
||||
"weren't",
|
||||
"what'll",
|
||||
"what's",
|
||||
"where's",
|
||||
"who'd",
|
||||
"who'll",
|
||||
"who's",
|
||||
"won't",
|
||||
"would've",
|
||||
"wouldn't",
|
||||
"you'd",
|
||||
"you'll",
|
||||
// 're contractions
|
||||
"you're",
|
||||
"you've"
|
||||
]);
|
||||
var CONTRACTION_FREQUENCY_BOOST = 1e7;
|
||||
var UNKNOWN_CONTRACTION_SCORE = -5e6;
|
||||
var NUMERIC_WORD_PENALTY = 1e6;
|
||||
var UNKNOWN_WORD_PENALTY = 1e5;
|
||||
var NUMERIC_REGEX = /\d/;
|
||||
function scoreWord(word) {
|
||||
const lower = word.toLowerCase();
|
||||
const frequency = loader.isLoaded() ? loader.get().map.get(lower) : void 0;
|
||||
const isCommonContraction = COMMON_CONTRACTIONS.has(lower);
|
||||
if (frequency !== void 0) {
|
||||
return isCommonContraction ? -frequency - CONTRACTION_FREQUENCY_BOOST : -frequency;
|
||||
}
|
||||
if (isCommonContraction) {
|
||||
return UNKNOWN_CONTRACTION_SCORE;
|
||||
}
|
||||
if (NUMERIC_REGEX.test(word)) {
|
||||
return NUMERIC_WORD_PENALTY + word.length;
|
||||
}
|
||||
return UNKNOWN_WORD_PENALTY + word.length;
|
||||
}
|
||||
function sortByFrequency(words) {
|
||||
return words.toSorted((a, b) => scoreWord(a) - scoreWord(b));
|
||||
}
|
||||
|
||||
// src/loader.ts
|
||||
var loader2 = createLazyLoader(async () => {
|
||||
const json = await loadJson("cmudict");
|
||||
if (json !== null) {
|
||||
const dict2 = json;
|
||||
Object.setPrototypeOf(dict2, null);
|
||||
return dict2;
|
||||
}
|
||||
const mod = await Promise.resolve().then(() => (init_cmudict(), cmudict_exports));
|
||||
const dict = mod.default;
|
||||
Object.setPrototypeOf(dict, null);
|
||||
return dict;
|
||||
}, "CMU dictionary");
|
||||
var loadDictionary = loader2.load.bind(loader2);
|
||||
var getDictionary = loader2.get.bind(loader2);
|
||||
var isDictionaryLoaded = loader2.isLoaded.bind(loader2);
|
||||
|
||||
// src/lookup.ts
|
||||
function lookupPronunciation(word) {
|
||||
return lookupPronunciationLower(word.toLowerCase());
|
||||
}
|
||||
function lookupPronunciationLower(key) {
|
||||
const custom = getCustomPronunciation(key);
|
||||
if (custom) {
|
||||
return custom;
|
||||
}
|
||||
const dict = getDictionary();
|
||||
if (!(key in dict)) {
|
||||
return null;
|
||||
}
|
||||
return dict[key];
|
||||
}
|
||||
|
||||
// src/reverse.ts
|
||||
var import_phonemes = require("@ingglish/phonemes");
|
||||
var loader3 = createLazyLoader(async () => {
|
||||
const json = await loadJson("reverse-cmudict");
|
||||
let dict;
|
||||
if (json === null) {
|
||||
const mod = await Promise.resolve().then(() => (init_reverse_cmudict(), reverse_cmudict_exports));
|
||||
dict = mod.default;
|
||||
} else {
|
||||
dict = json;
|
||||
}
|
||||
await loadFrequencies();
|
||||
for (const [word, phonemes] of Object.entries(CUSTOM_PRONUNCIATIONS)) {
|
||||
const key = phonemes.map((p) => (0, import_phonemes.stripStress)(p)).join(" ");
|
||||
const existing = dict[key];
|
||||
if (existing === void 0) {
|
||||
dict[key] = [word];
|
||||
} else if (!existing.includes(word)) {
|
||||
existing.push(word);
|
||||
dict[key] = sortByFrequency(existing);
|
||||
}
|
||||
}
|
||||
return dict;
|
||||
}, "Reverse dictionary");
|
||||
var loadReverseDictionary = loader3.load.bind(loader3);
|
||||
var getReverseDictionary = loader3.get.bind(loader3);
|
||||
function lookupPhonemeKey(key) {
|
||||
return getReverseDictionary()[key];
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
CUSTOM_PRONUNCIATIONS,
|
||||
getCustomPronunciation,
|
||||
getDictionary,
|
||||
getWordFrequency,
|
||||
hasCustomPronunciation,
|
||||
isDictionaryLoaded,
|
||||
loadDictionary,
|
||||
loadFrequencies,
|
||||
loadReverseDictionary,
|
||||
lookupPhonemeKey,
|
||||
lookupPronunciation,
|
||||
lookupPronunciationLower,
|
||||
sortByFrequency
|
||||
});
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Custom pronunciations that override CMU dictionary entries or add missing words.
|
||||
*
|
||||
* Two categories:
|
||||
* 1. CMU corrections — fix errors in existing CMU entries (verified vs Cambridge/Wiktionary)
|
||||
* 2. Additions — words not in CMU (tech terms, loanwords, etc.)
|
||||
*
|
||||
* Note: ~800 N-before-velar errors (N K → NG K, N G → NG G) are fixed automatically
|
||||
* by normalizeVelarNasal() in lookup.ts and don't need entries here.
|
||||
*/
|
||||
declare const CUSTOM_PRONUNCIATIONS: Record<string, string[]>;
|
||||
/**
|
||||
* Gets custom pronunciation for a word.
|
||||
* @param word The word to look up (should be lowercase for best performance)
|
||||
*/
|
||||
declare function getCustomPronunciation(word: string): string[] | undefined;
|
||||
/**
|
||||
* Checks if a word has a custom pronunciation.
|
||||
* @param word The word to look up (should be lowercase for best performance)
|
||||
*/
|
||||
declare function hasCustomPronunciation(word: string): boolean;
|
||||
|
||||
/**
|
||||
* Word frequency scoring using SUBTLEX corpus data.
|
||||
* Used for selecting the most common word among homophones.
|
||||
*/
|
||||
/**
|
||||
* Returns the frequency count for a word (higher = more common).
|
||||
* Returns undefined if word is not in the corpus or data hasn't loaded yet.
|
||||
*/
|
||||
declare function getWordFrequency(word: string): number | undefined;
|
||||
/**
|
||||
* Loads word frequency data.
|
||||
* The data is cached after first load.
|
||||
*/
|
||||
declare function loadFrequencies(): Promise<Record<string, number>>;
|
||||
/**
|
||||
* Sorts words by frequency (most common first).
|
||||
*/
|
||||
declare function sortByFrequency(words: string[]): string[];
|
||||
|
||||
type CMUDictionary = Record<string, string[]>;
|
||||
type ReverseDictionary = Record<string, string[]>;
|
||||
|
||||
/**
|
||||
* CMU Dictionary loading and caching.
|
||||
*
|
||||
* Dictionary sourced from: https://github.com/cmusphinx/cmudict
|
||||
*/
|
||||
|
||||
/**
|
||||
* Loads the CMU Pronouncing Dictionary.
|
||||
* The dictionary is cached after first load.
|
||||
*/
|
||||
declare const loadDictionary: () => Promise<CMUDictionary>;
|
||||
/**
|
||||
* Gets the dictionary synchronously.
|
||||
* Throws if dictionary hasn't been loaded yet.
|
||||
*/
|
||||
declare const getDictionary: () => CMUDictionary;
|
||||
/**
|
||||
* Checks if the dictionary is loaded.
|
||||
*/
|
||||
declare const isDictionaryLoaded: () => boolean;
|
||||
|
||||
/**
|
||||
* Looks up a word in the CMU dictionary, returning the ARPAbet IR.
|
||||
* Custom pronunciations override dictionary entries.
|
||||
* @param word The word to look up (case insensitive)
|
||||
* @returns ARPAbet phoneme array (the pipeline IR), or null if not found
|
||||
*/
|
||||
declare function lookupPronunciation(word: string): null | string[];
|
||||
/**
|
||||
* Like {@link lookupPronunciation}, but takes a **pre-lowercased** key.
|
||||
* Skips the `.toLowerCase()` call — use when the caller has already
|
||||
* confirmed the key is lowercase (e.g., fast-path code).
|
||||
*/
|
||||
declare function lookupPronunciationLower(key: string): null | string[];
|
||||
|
||||
/**
|
||||
* Reverse dictionary: phoneme sequence -> English words.
|
||||
*
|
||||
* Used for reverse translation (Ingglish/IPA -> English).
|
||||
* Pre-built at build time with words sorted by frequency.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Loads the pre-built reverse dictionary.
|
||||
* The dictionary is cached after first load.
|
||||
*/
|
||||
declare const loadReverseDictionary: () => Promise<ReverseDictionary>;
|
||||
/**
|
||||
* Looks up words for a phoneme key.
|
||||
* Results are pre-merged and frequency-sorted at load time.
|
||||
*/
|
||||
declare function lookupPhonemeKey(key: string): string[] | undefined;
|
||||
|
||||
export { CUSTOM_PRONUNCIATIONS, getCustomPronunciation, getDictionary, getWordFrequency, hasCustomPronunciation, isDictionaryLoaded, loadDictionary, loadFrequencies, loadReverseDictionary, lookupPhonemeKey, lookupPronunciation, lookupPronunciationLower, sortByFrequency };
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Custom pronunciations that override CMU dictionary entries or add missing words.
|
||||
*
|
||||
* Two categories:
|
||||
* 1. CMU corrections — fix errors in existing CMU entries (verified vs Cambridge/Wiktionary)
|
||||
* 2. Additions — words not in CMU (tech terms, loanwords, etc.)
|
||||
*
|
||||
* Note: ~800 N-before-velar errors (N K → NG K, N G → NG G) are fixed automatically
|
||||
* by normalizeVelarNasal() in lookup.ts and don't need entries here.
|
||||
*/
|
||||
declare const CUSTOM_PRONUNCIATIONS: Record<string, string[]>;
|
||||
/**
|
||||
* Gets custom pronunciation for a word.
|
||||
* @param word The word to look up (should be lowercase for best performance)
|
||||
*/
|
||||
declare function getCustomPronunciation(word: string): string[] | undefined;
|
||||
/**
|
||||
* Checks if a word has a custom pronunciation.
|
||||
* @param word The word to look up (should be lowercase for best performance)
|
||||
*/
|
||||
declare function hasCustomPronunciation(word: string): boolean;
|
||||
|
||||
/**
|
||||
* Word frequency scoring using SUBTLEX corpus data.
|
||||
* Used for selecting the most common word among homophones.
|
||||
*/
|
||||
/**
|
||||
* Returns the frequency count for a word (higher = more common).
|
||||
* Returns undefined if word is not in the corpus or data hasn't loaded yet.
|
||||
*/
|
||||
declare function getWordFrequency(word: string): number | undefined;
|
||||
/**
|
||||
* Loads word frequency data.
|
||||
* The data is cached after first load.
|
||||
*/
|
||||
declare function loadFrequencies(): Promise<Record<string, number>>;
|
||||
/**
|
||||
* Sorts words by frequency (most common first).
|
||||
*/
|
||||
declare function sortByFrequency(words: string[]): string[];
|
||||
|
||||
type CMUDictionary = Record<string, string[]>;
|
||||
type ReverseDictionary = Record<string, string[]>;
|
||||
|
||||
/**
|
||||
* CMU Dictionary loading and caching.
|
||||
*
|
||||
* Dictionary sourced from: https://github.com/cmusphinx/cmudict
|
||||
*/
|
||||
|
||||
/**
|
||||
* Loads the CMU Pronouncing Dictionary.
|
||||
* The dictionary is cached after first load.
|
||||
*/
|
||||
declare const loadDictionary: () => Promise<CMUDictionary>;
|
||||
/**
|
||||
* Gets the dictionary synchronously.
|
||||
* Throws if dictionary hasn't been loaded yet.
|
||||
*/
|
||||
declare const getDictionary: () => CMUDictionary;
|
||||
/**
|
||||
* Checks if the dictionary is loaded.
|
||||
*/
|
||||
declare const isDictionaryLoaded: () => boolean;
|
||||
|
||||
/**
|
||||
* Looks up a word in the CMU dictionary, returning the ARPAbet IR.
|
||||
* Custom pronunciations override dictionary entries.
|
||||
* @param word The word to look up (case insensitive)
|
||||
* @returns ARPAbet phoneme array (the pipeline IR), or null if not found
|
||||
*/
|
||||
declare function lookupPronunciation(word: string): null | string[];
|
||||
/**
|
||||
* Like {@link lookupPronunciation}, but takes a **pre-lowercased** key.
|
||||
* Skips the `.toLowerCase()` call — use when the caller has already
|
||||
* confirmed the key is lowercase (e.g., fast-path code).
|
||||
*/
|
||||
declare function lookupPronunciationLower(key: string): null | string[];
|
||||
|
||||
/**
|
||||
* Reverse dictionary: phoneme sequence -> English words.
|
||||
*
|
||||
* Used for reverse translation (Ingglish/IPA -> English).
|
||||
* Pre-built at build time with words sorted by frequency.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Loads the pre-built reverse dictionary.
|
||||
* The dictionary is cached after first load.
|
||||
*/
|
||||
declare const loadReverseDictionary: () => Promise<ReverseDictionary>;
|
||||
/**
|
||||
* Looks up words for a phoneme key.
|
||||
* Results are pre-merged and frequency-sorted at load time.
|
||||
*/
|
||||
declare function lookupPhonemeKey(key: string): string[] | undefined;
|
||||
|
||||
export { CUSTOM_PRONUNCIATIONS, getCustomPronunciation, getDictionary, getWordFrequency, hasCustomPronunciation, isDictionaryLoaded, loadDictionary, loadFrequencies, loadReverseDictionary, lookupPhonemeKey, lookupPronunciation, lookupPronunciationLower, sortByFrequency };
|
||||
+612
@@ -0,0 +1,612 @@
|
||||
// src/custom-words.ts
|
||||
var CUSTOM_PRONUNCIATIONS = {
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — wrong consonant
|
||||
// ---------------------------------------------------------------------------
|
||||
abele: ["AH0", "B", "IY1", "L"],
|
||||
// /əˈbil/ — CMU has /ɛ/ for /i/
|
||||
abstention: ["AH0", "B", "S", "T", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /əbˈstɛnʃən/ — CMU has /tʃ/
|
||||
abstentions: ["AH0", "B", "S", "T", "EH1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /əbˈstɛnʃənz/ — CMU has /tʃ/
|
||||
actuator: ["AE1", "K", "CH", "UW0", "EY2", "T", "ER0"],
|
||||
// /ˈæktʃuˌeɪtɝ/ — CMU has /tj/
|
||||
actuators: ["AE1", "K", "CH", "UW0", "EY2", "T", "ER0", "Z"],
|
||||
// /ˈæktʃuˌeɪtɝz/ — CMU has /tj/
|
||||
africa: ["AE1", "F", "R", "IH0", "K", "AH0"],
|
||||
// /ˈæfrɪkə/ — CMU has /ə/ for /ɪ/ and /ɑ/ for /ə/
|
||||
alienate: ["EY1", "L", "IY0", "AH0", "N", "EY2", "T"],
|
||||
// /ˈeɪliəˌneɪt/ — CMU has /j/ for /i/
|
||||
// CMU has /s/ instead of /ʃ/ in -ciate/-ciation suffix
|
||||
associate: ["AH0", "S", "OW1", "SH", "IY0", "AH0", "T"],
|
||||
// /əˈsoʊʃiˌət/ — CMU has /s/
|
||||
associated: ["AH0", "S", "OW1", "SH", "IY0", "EY2", "T", "IH0", "D"],
|
||||
// /əˈsoʊʃiˌeɪtɪd/ — CMU has /s/
|
||||
associates: ["AH0", "S", "OW1", "SH", "IY0", "AH0", "T", "S"],
|
||||
// /əˈsoʊʃiˌəts/ — CMU has /s/
|
||||
associating: ["AH0", "S", "OW1", "SH", "IY0", "EY2", "T", "IH0", "NG"],
|
||||
// /əˈsoʊʃiˌeɪtɪŋ/ — CMU has /s/
|
||||
association: ["AH0", "S", "OW2", "SH", "IY0", "EY1", "SH", "AH0", "N"],
|
||||
// /əˌsoʊʃiˈeɪʃən/ — CMU has /s/
|
||||
associations: ["AH0", "S", "OW2", "SH", "IY0", "EY1", "SH", "AH0", "N", "Z"],
|
||||
// /əˌsoʊʃiˈeɪʃənz/ — CMU has /s/
|
||||
// Tech terms
|
||||
async: ["EY1", "S", "IH0", "NG", "K"],
|
||||
// /ˈeɪsɪŋk/
|
||||
blog: ["B", "L", "AO1", "G"],
|
||||
// /blɔɡ/
|
||||
bocce: ["B", "AA1", "CH", "IY0"],
|
||||
// /ˈbɑtʃi/ — CMU has /oʊ/ for /ɑ/
|
||||
// Foreign loanwords
|
||||
brulee: ["B", "R", "UW0", "L", "EY1"],
|
||||
// /bruˈleɪ/
|
||||
buffet: ["B", "AH0", "F", "EY1"],
|
||||
// /bʌˈfeɪ/ — CMU has verb "to strike", should be noun (food)
|
||||
// Linguistic terms missing from CMU
|
||||
camelcase: ["K", "AE1", "M", "AH0", "L", "K", "EY2", "S"],
|
||||
// /ˈkæməlˌkeɪs/ — G2P gives /eɪ/ for first vowel
|
||||
ceaselessly: ["S", "IY1", "S", "L", "AH0", "S", "L", "IY0"],
|
||||
// /ˈsisləsli/ — CMU has /z/
|
||||
// Irregular English words
|
||||
chamois: ["SH", "AE1", "M", "IY0"],
|
||||
// /ˈʃæmi/
|
||||
chatgpt: ["CH", "AE1", "T", "JH", "IY1", "P", "IY1", "T", "IY1"],
|
||||
// /tʃæt dʒi pi ti/
|
||||
cholmondeley: ["CH", "AH1", "M", "L", "IY0"],
|
||||
// /ˈtʃʌmli/
|
||||
circumflex: ["S", "ER1", "K", "AH0", "M", "F", "L", "EH2", "K", "S"],
|
||||
// /ˈsɜrkəmˌflɛks/ — G2P inserts vowel in fl cluster
|
||||
circumvention: ["S", "ER2", "K", "AH0", "M", "V", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ˌsɝkəmˈvɛnʃən/ — CMU has /tʃ/
|
||||
close: ["K", "L", "OW1", "Z"],
|
||||
// /kloʊz/ — CMU default is adjective /kloʊs/
|
||||
conscientiously: ["K", "AA2", "N", "SH", "IY0", "EH1", "N", "SH", "AH0", "S", "L", "IY0"],
|
||||
// /ˌkɑnʃiˈɛnʃəsli/ — CMU has /tʃ/
|
||||
contravention: ["K", "AA2", "N", "T", "R", "AH0", "V", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ˌkɑntrəˈvɛnʃən/ — CMU has /tʃ/
|
||||
convulsant: ["K", "AH0", "N", "V", "AH1", "L", "S", "AH0", "N", "T"],
|
||||
// /kənˈvʌlsənt/ — CMU missing /n/
|
||||
// Inconsistent vowel in derived form
|
||||
coughed: ["K", "AA1", "F", "T"],
|
||||
// /kɑft/ — CMU has /ɔ/ (AO), should match cough's /ɑ/ (AA)
|
||||
coughs: ["K", "AA1", "F", "S"],
|
||||
// /kɑfs/ — CMU has /ɔ/ (AO), should match cough's /ɑ/ (AA)
|
||||
cuckoo: ["K", "UW1", "K", "UW0"],
|
||||
// /ˈkuku/ — CMU has /ʌ/ for first vowel
|
||||
// Wrong vowel
|
||||
dedicate: ["D", "EH1", "D", "IH0", "K", "EY2", "T"],
|
||||
// /ˈdɛdɪˌkeɪt/ — CMU has /ə/ for /ɪ/
|
||||
dedicated: ["D", "EH1", "D", "IH0", "K", "EY0", "T", "IH0", "D"],
|
||||
// /ˈdɛdɪkeɪtɪd/ — CMU has /ə/ for /ɪ/
|
||||
dedication: ["D", "EH2", "D", "IH0", "K", "EY1", "SH", "AH0", "N"],
|
||||
// /ˌdɛdɪˈkeɪʃən/ — CMU has /ə/ for /ɪ/
|
||||
// Wrong consonant in derived form
|
||||
deliciously: ["D", "IH0", "L", "IH1", "SH", "AH0", "S", "L", "IY0"],
|
||||
// /dɪˈlɪʃəsli/ — CMU has /ʃ/ for final /s/
|
||||
derivational: ["D", "EH2", "R", "IH0", "V", "EY1", "SH", "AH0", "N", "AH0", "L"],
|
||||
// /ˌdɛrɪˈveɪʃənəl/ — G2P gives /aɪ/ for first vowel
|
||||
// Website/tech terms missing from CMU
|
||||
digraph: ["D", "AY1", "G", "R", "AE2", "F"],
|
||||
// /ˈdaɪˌɡræf/ — G2P gives short /ɪ/
|
||||
digraphs: ["D", "AY1", "G", "R", "AE2", "F", "S"],
|
||||
// /ˈdaɪˌɡræfs/
|
||||
// Wrong syllable count
|
||||
doer: ["D", "UW1", "ER0"],
|
||||
// /ˈduɝ/ — CMU has 1 syllable (D UW1 R), should be 2 like doers
|
||||
doppelganger: ["D", "AA1", "P", "AH0", "L", "G", "AE2", "NG", "ER0"],
|
||||
// /ˈdɑpəlˌɡæŋɝ/
|
||||
drachm: ["D", "R", "AE1", "M"],
|
||||
// /dræm/ — silent ch
|
||||
// Spurious /j/ glide (British /juː/ where AmE uses /uː/)
|
||||
dudes: ["D", "UW1", "D", "Z"],
|
||||
// /duːdz/ — CMU has /dju/, should match dude's /du/
|
||||
duplicates: ["D", "UW1", "P", "L", "AH0", "K", "EY2", "T", "S"],
|
||||
// /ˈdupləˌkeɪts/ — CMU has /dju/
|
||||
duplication: ["D", "UW2", "P", "L", "AH0", "K", "EY1", "SH", "AH0", "N"],
|
||||
// /ˌdupləˈkeɪʃən/ — CMU has /dju/
|
||||
emoji: ["IH0", "M", "OW1", "JH", "IY0"],
|
||||
// /ɪˈmoʊdʒi/
|
||||
engenders: ["EH0", "N", "JH", "EH1", "N", "D", "ER0", "Z"],
|
||||
// /ɛnˈdʒɛndɝz/ — CMU has /ŋɡ/
|
||||
excruciatingly: [
|
||||
"EH2",
|
||||
"K",
|
||||
"S",
|
||||
"K",
|
||||
"R",
|
||||
"UW1",
|
||||
"SH",
|
||||
"IY0",
|
||||
"EY2",
|
||||
"T",
|
||||
"IH0",
|
||||
"NG",
|
||||
"L",
|
||||
"IY0"
|
||||
],
|
||||
// /ɪkˈskruʃiˌeɪtɪŋli/ — CMU has /s/ (excruciating is correct)
|
||||
expos\u00E9: ["EH2", "K", "S", "P", "OW0", "Z", "EY1"],
|
||||
// /ˌɛkspoʊˈzeɪ/ — French noun (report), not verb "to expose"
|
||||
favicon: ["F", "AE1", "V", "IH0", "K", "AA2", "N"],
|
||||
// /ˈfævɪˌkɑn/ — "favorite icon"
|
||||
fiancee: ["F", "IY0", "AA0", "N", "S", "EY1"],
|
||||
// /fiɑnˈseɪ/ — CMU has wrong final syllable
|
||||
finagle: ["F", "IH0", "N", "EY1", "G", "AH0", "L"],
|
||||
// /fɪˈneɪɡəl/ — CMU has /ə/ for /eɪ/, wrong stress
|
||||
flambe: ["F", "L", "AA0", "M", "B", "EY1"],
|
||||
// /flɑmˈbeɪ/
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — wrong vowel or glide
|
||||
// ---------------------------------------------------------------------------
|
||||
// Missing phoneme
|
||||
forgings: ["F", "AO1", "R", "JH", "IH0", "NG", "Z"],
|
||||
// /ˈfɔrdʒɪŋz/ — CMU missing /r/
|
||||
fraudulently: ["F", "R", "AO1", "JH", "AH0", "L", "AH0", "N", "T", "L", "IY0"],
|
||||
// /ˈfrɔdʒələntli/ — CMU has /d/
|
||||
// Days of the week: CMU v1 has /i/ but standard AmE uses /eɪ/
|
||||
friday: ["F", "R", "AY1", "D", "EY2"],
|
||||
// /ˈfraɪˌdeɪ/
|
||||
gestalt: ["G", "AH0", "SH", "T", "AA1", "L", "T"],
|
||||
// /ɡəˈʃtɑlt/
|
||||
github: ["G", "IH1", "T", "HH", "AH1", "B"],
|
||||
// /ˈɡɪtˌhʌb/
|
||||
grandma: ["G", "R", "AE1", "N", "M", "AA2"],
|
||||
// /ˈɡrænˌmɑ/ — CMU has spurious /d/
|
||||
haphazardly: ["HH", "AE0", "P", "HH", "AE1", "Z", "ER0", "D", "L", "IY0"],
|
||||
// /hæpˈhæzɝdli/ — CMU has /f/
|
||||
headquartered: ["HH", "EH1", "D", "K", "W", "AO2", "R", "T", "ER0", "D"],
|
||||
// /ˈhɛdˌkwɔrtɝd/ — CMU missing /w/
|
||||
hors: ["AO1", "R"],
|
||||
// /ɔr/ — CMU wrong; French: silent h and s (hors d'oeuvres)
|
||||
iframe: ["AY1", "F", "R", "EY2", "M"],
|
||||
// /ˈaɪˌfreɪm/ — G2P gives short /ɪ/ for "i"
|
||||
immature: ["IH2", "M", "AH0", "CH", "UH1", "R"],
|
||||
// /ˌɪməˈtʃʊr/ — CMU has /tj/ (British), should match mature's /tʃ/
|
||||
inattention: ["IH2", "N", "AH0", "T", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ˌɪnəˈtɛnʃən/ — CMU has /tʃ/
|
||||
// N→NG + additional vowel fix (N→NG alone handled by normalizeVelarNasal)
|
||||
inconclusively: ["IH2", "NG", "K", "AH0", "NG", "K", "L", "UW1", "S", "IH0", "V", "L", "IY0"],
|
||||
// /ˌɪŋkəŋˈklusɪvli/ — CMU has /nk/
|
||||
initialisms: ["IH0", "N", "IH1", "SH", "AH0", "L", "IH2", "Z", "AH0", "M", "Z"],
|
||||
// /ɪˈnɪʃəˌlɪzəmz/
|
||||
// CMU has /tʃ/ instead of /ʃ/ in -tion/-sion suffix after N
|
||||
intention: ["IH0", "N", "T", "EH1", "N", "SH", "AH0", "N"],
|
||||
// /ɪnˈtɛnʃən/ — CMU has /tʃ/
|
||||
intentions: ["IH0", "N", "T", "EH1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /ɪnˈtɛnʃənz/ — CMU has /tʃ/
|
||||
islington: ["IH1", "Z", "L", "IH0", "NG", "T", "AH0", "N"],
|
||||
// /ˈɪzlɪŋtən/
|
||||
lead: ["L", "IY1", "D"],
|
||||
// /liːd/ — CMU default is metal /lɛd/
|
||||
legalese: ["L", "IY2", "G", "AH0", "L", "IY1", "Z"],
|
||||
// /ˌliɡəˈliz/ — CMU has /ɛ/, /s/, wrong stress
|
||||
legit: ["L", "AH0", "JH", "IH1", "T"],
|
||||
// /ləˈdʒɪt/ — CMU has /ɛ/ and wrong stress
|
||||
leisure: ["L", "IY1", "ZH", "ER0"],
|
||||
// /ˈliʒɝ/ — CMU has British /ɛ/, AmE is /i/
|
||||
leniently: ["L", "IY1", "N", "IY0", "AH0", "N", "T", "L", "IY0"],
|
||||
// /ˈliniəntli/ — CMU has /j/ for /i/
|
||||
live: ["L", "IH1", "V"],
|
||||
// /lɪv/ — CMU default is adjective /laɪv/
|
||||
localhost: ["L", "OW1", "K", "AH0", "L", "HH", "OW2", "S", "T"],
|
||||
// /ˈloʊkəlˌhoʊst/
|
||||
manana: ["M", "AE0", "N", "Y", "AA1", "N", "AH0"],
|
||||
// /mænˈjɑnə/
|
||||
mansions: ["M", "AE1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /ˈmænʃənz/ — CMU has /tʃ/ (singular is correct)
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — wrong word sense or incomplete entry
|
||||
// ---------------------------------------------------------------------------
|
||||
matured: ["M", "AH0", "CH", "UH1", "R", "D"],
|
||||
// /məˈtʃʊrd/ — CMU has /tj/ (British), should match mature's /tʃ/
|
||||
monday: ["M", "AH1", "N", "D", "EY2"],
|
||||
// /ˈmʌnˌdeɪ/
|
||||
navbar: ["N", "AE1", "V", "B", "AA2", "R"],
|
||||
// /ˈnævˌbɑr/ — "navigation bar"; G2P gives /ɚ/ for second vowel
|
||||
negligee: ["N", "EH1", "G", "L", "AH0", "ZH", "EY2"],
|
||||
// /ˈnɛɡləˌʒeɪ/
|
||||
// ---------------------------------------------------------------------------
|
||||
// CMU corrections — variant ordering (v1 wrong for standard AmE)
|
||||
// ---------------------------------------------------------------------------
|
||||
nemo: ["N", "IY1", "M", "OW0"],
|
||||
// /ˈnimoʊ/ — CMU has /ɛ/ for /i/
|
||||
npm: ["EH1", "N", "P", "IY1", "EH1", "M"],
|
||||
// /ɛn pi ɛm/
|
||||
oauth: ["OW1", "AO1", "TH"],
|
||||
// /oʊɔθ/
|
||||
obsequies: ["AA1", "B", "S", "IH0", "K", "W", "IY0", "Z"],
|
||||
// /ˈɑbsɪkwiz/
|
||||
oppugnant: ["AH0", "P", "AH1", "G", "N", "AH0", "N", "T"],
|
||||
// /əˈpʌɡnənt/
|
||||
oppugners: ["AH0", "P", "Y", "UW1", "N", "ER0", "Z"],
|
||||
// /əˈpjunɝz/ — silent g
|
||||
orthographic: ["AO2", "R", "TH", "AH0", "G", "R", "AE1", "F", "IH0", "K"],
|
||||
// /ˌɔrθəˈɡræfɪk/
|
||||
ow: ["AW1"],
|
||||
// /aʊ/ — CMU has /oʊ/
|
||||
padre: ["P", "AA1", "D", "R", "EY0"],
|
||||
// /ˈpɑdreɪ/ — CMU has /æ/ for /ɑ/
|
||||
parameterized: ["P", "ER0", "AE1", "M", "IH0", "T", "ER0", "AY2", "Z", "D"],
|
||||
// /pəˈræmɪtəˌraɪzd/ — G2P gives /eɪ/ for first syllable
|
||||
patisserie: ["P", "AH0", "T", "IH1", "S", "ER0", "IY0"],
|
||||
// /pəˈtɪsɝi/
|
||||
permalink: ["P", "ER1", "M", "AH0", "L", "IH2", "NG", "K"],
|
||||
// /ˈpɝməˌlɪŋk/ — "permanent link"
|
||||
phaeton: ["F", "EY1", "IH0", "T", "AH0", "N"],
|
||||
// /ˈfeɪɪtən/
|
||||
pinata: ["P", "IH0", "N", "Y", "AA1", "T", "AH0"],
|
||||
// /pɪnˈjɑtə/
|
||||
piquet: ["P", "IH0", "K", "EY1"],
|
||||
// /pɪˈkeɪ/
|
||||
// ---------------------------------------------------------------------------
|
||||
// Additions — words not in CMU dictionary
|
||||
// ---------------------------------------------------------------------------
|
||||
placeholder: ["P", "L", "EY1", "S", "HH", "OW2", "L", "D", "ER0"],
|
||||
// /ˈpleɪsˌhoʊldɝ/
|
||||
podcast: ["P", "AA1", "D", "K", "AE2", "S", "T"],
|
||||
// /ˈpɑdˌkæst/
|
||||
potshots: ["P", "AA1", "SH", "AA2", "T", "S"],
|
||||
// /ˈpɑtˌʃɑts/ — CMU has /tʃ/, should match potshot's /ʃ/
|
||||
president: ["P", "R", "EH1", "Z", "IH0", "D", "AH0", "N", "T"],
|
||||
// /ˈprɛzɪdənt/ — CMU has /ə/ for /ɪ/ and /ɛ/ for /ə/
|
||||
// Voicing errors (/s/↔/z/, /θ/↔/ð/)
|
||||
presidentially: ["P", "R", "EH2", "Z", "IH0", "D", "EH1", "N", "SH", "AH0", "L", "IY0"],
|
||||
// /ˌprɛzɪˈdɛnʃəli/ — CMU has /s/
|
||||
privatize: ["P", "R", "AY1", "V", "AH0", "T", "AY2", "Z"],
|
||||
// /ˈpraɪvəˌtaɪz/ — CMU has /ɪ/ for /aɪ/, should match private
|
||||
// Silent letter pronounced
|
||||
psalm: ["S", "AA1", "M"],
|
||||
// /sɑm/ — CMU has /l/, but L is silent in psalm
|
||||
psalms: ["S", "AA1", "M", "Z"],
|
||||
// /sɑmz/ — CMU has /l/, but L is silent in psalm
|
||||
puisne: ["P", "Y", "UW1", "N", "IY0"],
|
||||
// /ˈpjuni/
|
||||
// Homographs: CMU default is the less common sense
|
||||
read: ["R", "IY1", "D"],
|
||||
// /riːd/ — CMU default is past tense /rɛd/
|
||||
record: ["R", "EH1", "K", "ER0", "D"],
|
||||
// /ˈrɛkɝd/ — CMU default is verb /rɪˈkɔrd/
|
||||
rededicate: ["R", "IY2", "D", "EH1", "D", "IH0", "K", "EY2", "T"],
|
||||
// /ˌriˈdɛdɪˌkeɪt/ — CMU has /ə/ for /ɪ/
|
||||
rededication: ["R", "IY0", "D", "EH2", "D", "IH0", "K", "EY1", "SH", "AH0", "N"],
|
||||
// /riˌdɛdɪˈkeɪʃən/ — CMU has /ə/ for /ɪ/
|
||||
regex: ["R", "EH1", "JH", "EH0", "K", "S"],
|
||||
// /ˈrɛdʒɛks/ — G2P gives /iː/ for first vowel
|
||||
reschedulings: ["R", "IY0", "S", "K", "EH1", "JH", "UW0", "L", "IH0", "NG", "Z"],
|
||||
// /riˈskɛdʒulɪŋz/ — CMU has /ʃ/ (British)
|
||||
resolutely: ["R", "EH1", "Z", "AH0", "L", "UW2", "T", "L", "IY0"],
|
||||
// /ˈrɛzəˌlutli/ — CMU has /s/
|
||||
// Accented homographs: diacritics signal a different word than CMU's default
|
||||
r\u00E9sum\u00E9: ["R", "EH1", "Z", "AH0", "M", "EY2"],
|
||||
// /ˈrɛzəˌmeɪ/ — French noun (CV), not verb "to resume"
|
||||
retroflex: ["R", "EH1", "T", "R", "OW0", "F", "L", "EH2", "K", "S"],
|
||||
// /ˈrɛtroʊˌflɛks/ — G2P gives /iː/ + epenthetic vowel in fl
|
||||
revaluations: ["R", "IY0", "V", "AE2", "L", "Y", "UW0", "EY1", "SH", "AH0", "N", "Z"],
|
||||
// /riˌvæljueɪʃənz/ — CMU has extra /ɪ/
|
||||
roommate: ["R", "UW1", "M", "M", "EY2", "T"],
|
||||
// /ˈrumˌmeɪt/ — CMU missing geminate /mm/
|
||||
roommates: ["R", "UW1", "M", "M", "EY2", "T", "S"],
|
||||
// /ˈrumˌmeɪts/ — CMU missing geminate /mm/
|
||||
saturday: ["S", "AE1", "T", "ER0", "D", "EY2"],
|
||||
// /ˈsætɝˌdeɪ/
|
||||
soupcon: ["S", "UW0", "P", "S", "AA1", "N"],
|
||||
// /supˈsɑn/
|
||||
streatham: ["S", "T", "R", "EH1", "T", "AH0", "M"],
|
||||
// /ˈstrɛtəm/
|
||||
syllabification: ["S", "IH0", "L", "AE1", "B", "IH0", "F", "IH0", "K", "EY2", "SH", "AH0", "N"],
|
||||
// /sɪˌlæbɪfɪˈkeɪʃən/ — G2P drops /b/
|
||||
temptation: ["T", "EH0", "M", "P", "T", "EY1", "SH", "AH0", "N"],
|
||||
// /tɛmpˈteɪʃən/ — CMU missing /p/
|
||||
temptations: ["T", "EH0", "M", "P", "T", "EY1", "SH", "AH0", "N", "Z"],
|
||||
// /tɛmpˈteɪʃənz/ — CMU missing /p/
|
||||
tensions: ["T", "EH1", "N", "SH", "AH0", "N", "Z"],
|
||||
// /ˈtɛnʃənz/ — CMU has /tʃ/ (singular is correct)
|
||||
terpsichore: ["T", "ER0", "P", "S", "IH1", "K", "ER0", "IY0"],
|
||||
// /tɝpˈsɪkɝi/
|
||||
// Missing contracted "is" — "this'" = "this is", needs epenthetic /əz/ since base ends in /s/
|
||||
"this'": ["DH", "IH1", "S", "AH0", "Z"],
|
||||
// /ðɪsəz/ — CMU has /ðɪs/ (same as "this", missing "is")
|
||||
thyme: ["T", "AY1", "M"],
|
||||
// /taɪm/ — CMU has /θ/, but h is silent
|
||||
touche: ["T", "UW0", "SH", "EY1"],
|
||||
// /tuˈʃeɪ/ — CMU missing final syllable
|
||||
transliteration: ["T", "R", "AE2", "N", "Z", "L", "IH0", "T", "ER0", "EY1", "SH", "AH0", "N"],
|
||||
// /ˌtrænzlɪtəˈreɪʃən/
|
||||
tuesday: ["T", "UW1", "Z", "D", "EY2"],
|
||||
// /ˈtuzˌdeɪ/
|
||||
tuition: ["T", "UW0", "IH1", "SH", "AH0", "N"],
|
||||
// /tuˈɪʃən/ — CMU has /tju/
|
||||
unknowns: ["AH0", "N", "N", "OW1", "N", "Z"],
|
||||
// /ənˈnoʊnz/ — CMU missing second /n/
|
||||
use: ["Y", "UW1", "Z"],
|
||||
// /juːz/ — CMU default is noun /juːs/
|
||||
valium: ["V", "AE1", "L", "IY0", "AH0", "M"],
|
||||
// /ˈvæliəm/ — CMU has /eɪ/ for /æ/
|
||||
velar: ["V", "IY1", "L", "ER0"],
|
||||
// /ˈviːlɚ/ — G2P gives short /ɛ/ for first vowel
|
||||
victual: ["V", "IH1", "T", "AH0", "L"],
|
||||
// /ˈvɪtəl/ — silent c
|
||||
victuals: ["V", "IH1", "T", "AH0", "L", "Z"],
|
||||
// /ˈvɪtəlz/ — silent c
|
||||
vlog: ["V", "L", "AO1", "G"],
|
||||
// /vlɔɡ/
|
||||
// Abbreviations
|
||||
vs: ["V", "ER1", "S", "AH0", "S"],
|
||||
// /ˈvɝsəs/
|
||||
webpack: ["W", "EH1", "B", "P", "AE1", "K"],
|
||||
// /ˈwɛbˌpæk/
|
||||
wednesday: ["W", "EH1", "N", "Z", "D", "EY2"],
|
||||
// /ˈwɛnzˌdeɪ/
|
||||
"well-doer": ["W", "EH1", "L", "D", "UW1", "ER0"],
|
||||
// /ˈwɛlˌduɝ/ — CMU has 1-syllable doer
|
||||
wind: ["W", "IH1", "N", "D"],
|
||||
// /wɪnd/ — CMU default is verb /waɪnd/
|
||||
withdrawals: ["W", "IH0", "DH", "D", "R", "AO1", "AH0", "L", "Z"],
|
||||
// /wɪðˈdrɔəlz/ — CMU has /θ/
|
||||
withdrawing: ["W", "IH0", "DH", "D", "R", "AO1", "IH0", "NG"],
|
||||
// /wɪðˈdrɔɪŋ/ — CMU has /θ/
|
||||
withdrawn: ["W", "IH0", "DH", "D", "R", "AO1", "N"]
|
||||
// /wɪðˈdrɔn/ — CMU has /θ/
|
||||
};
|
||||
var CUSTOM_MAP = new Map(Object.entries(CUSTOM_PRONUNCIATIONS));
|
||||
function getCustomPronunciation(word) {
|
||||
return CUSTOM_MAP.get(word);
|
||||
}
|
||||
function hasCustomPronunciation(word) {
|
||||
return CUSTOM_MAP.has(word);
|
||||
}
|
||||
|
||||
// src/lazy-loader.ts
|
||||
function createLazyLoader(loadFn, errorLabel) {
|
||||
let data = null;
|
||||
let promise = null;
|
||||
return {
|
||||
get() {
|
||||
if (data === null) {
|
||||
throw new Error(`${errorLabel} not loaded. Call load() first.`);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
isLoaded() {
|
||||
return data !== null;
|
||||
},
|
||||
load() {
|
||||
if (data !== null) {
|
||||
return Promise.resolve(data);
|
||||
}
|
||||
if (promise !== null) {
|
||||
return promise;
|
||||
}
|
||||
promise = loadFn().then((result) => {
|
||||
data = result;
|
||||
return data;
|
||||
}).catch((error) => {
|
||||
promise = null;
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
throw new Error(`Failed to load ${errorLabel}: ${message}`);
|
||||
});
|
||||
return promise;
|
||||
},
|
||||
reset() {
|
||||
data = null;
|
||||
promise = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// src/load-json.ts
|
||||
async function loadJson(basename) {
|
||||
if (typeof process === "undefined" || !process.versions?.node) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const { readFileSync } = await import("fs");
|
||||
const { fileURLToPath } = await import("url");
|
||||
const thisFile = fileURLToPath(import.meta.url);
|
||||
const dir = thisFile.slice(0, thisFile.lastIndexOf("/"));
|
||||
return JSON.parse(readFileSync(`${dir}/${basename}.json`, "utf8"));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// src/frequency.ts
|
||||
var loader = createLazyLoader(async () => {
|
||||
const json = await loadJson("data/word-frequencies");
|
||||
let raw;
|
||||
if (json === null) {
|
||||
const mod = await import("./word-frequencies-CWZLI3FK.js");
|
||||
raw = mod.default;
|
||||
} else {
|
||||
raw = json;
|
||||
}
|
||||
const map = /* @__PURE__ */ new Map();
|
||||
for (const [word, count] of Object.entries(raw)) {
|
||||
map.set(word.toLowerCase(), count);
|
||||
}
|
||||
return { map, raw };
|
||||
}, "word frequencies");
|
||||
function getWordFrequency(word) {
|
||||
if (!loader.isLoaded()) {
|
||||
return void 0;
|
||||
}
|
||||
return loader.get().map.get(word.toLowerCase());
|
||||
}
|
||||
async function loadFrequencies() {
|
||||
const data = await loader.load();
|
||||
return data.raw;
|
||||
}
|
||||
var COMMON_CONTRACTIONS = /* @__PURE__ */ new Set([
|
||||
"ain't",
|
||||
"aren't",
|
||||
// n't contractions
|
||||
"can't",
|
||||
"could've",
|
||||
"couldn't",
|
||||
"didn't",
|
||||
"doesn't",
|
||||
"don't",
|
||||
"hadn't",
|
||||
"hasn't",
|
||||
"haven't",
|
||||
"he'd",
|
||||
"he'll",
|
||||
// 's contractions (is/has)
|
||||
"he's",
|
||||
"here's",
|
||||
"how's",
|
||||
// 'd contractions
|
||||
"i'd",
|
||||
// 'll contractions
|
||||
"i'll",
|
||||
// 'm contractions
|
||||
"i'm",
|
||||
// 've contractions
|
||||
"i've",
|
||||
"isn't",
|
||||
"it'd",
|
||||
"it'll",
|
||||
"it's",
|
||||
"let's",
|
||||
"might've",
|
||||
"mightn't",
|
||||
"must've",
|
||||
"mustn't",
|
||||
"needn't",
|
||||
"shan't",
|
||||
"she'd",
|
||||
"she'll",
|
||||
"she's",
|
||||
"should've",
|
||||
"shouldn't",
|
||||
"that'd",
|
||||
"that'll",
|
||||
"that's",
|
||||
"there'll",
|
||||
"there's",
|
||||
"they'd",
|
||||
"they'll",
|
||||
"they're",
|
||||
"they've",
|
||||
"wasn't",
|
||||
"we'd",
|
||||
"we'll",
|
||||
"we're",
|
||||
"we've",
|
||||
"weren't",
|
||||
"what'll",
|
||||
"what's",
|
||||
"where's",
|
||||
"who'd",
|
||||
"who'll",
|
||||
"who's",
|
||||
"won't",
|
||||
"would've",
|
||||
"wouldn't",
|
||||
"you'd",
|
||||
"you'll",
|
||||
// 're contractions
|
||||
"you're",
|
||||
"you've"
|
||||
]);
|
||||
var CONTRACTION_FREQUENCY_BOOST = 1e7;
|
||||
var UNKNOWN_CONTRACTION_SCORE = -5e6;
|
||||
var NUMERIC_WORD_PENALTY = 1e6;
|
||||
var UNKNOWN_WORD_PENALTY = 1e5;
|
||||
var NUMERIC_REGEX = /\d/;
|
||||
function scoreWord(word) {
|
||||
const lower = word.toLowerCase();
|
||||
const frequency = loader.isLoaded() ? loader.get().map.get(lower) : void 0;
|
||||
const isCommonContraction = COMMON_CONTRACTIONS.has(lower);
|
||||
if (frequency !== void 0) {
|
||||
return isCommonContraction ? -frequency - CONTRACTION_FREQUENCY_BOOST : -frequency;
|
||||
}
|
||||
if (isCommonContraction) {
|
||||
return UNKNOWN_CONTRACTION_SCORE;
|
||||
}
|
||||
if (NUMERIC_REGEX.test(word)) {
|
||||
return NUMERIC_WORD_PENALTY + word.length;
|
||||
}
|
||||
return UNKNOWN_WORD_PENALTY + word.length;
|
||||
}
|
||||
function sortByFrequency(words) {
|
||||
return words.toSorted((a, b) => scoreWord(a) - scoreWord(b));
|
||||
}
|
||||
|
||||
// src/loader.ts
|
||||
var loader2 = createLazyLoader(async () => {
|
||||
const json = await loadJson("cmudict");
|
||||
if (json !== null) {
|
||||
const dict2 = json;
|
||||
Object.setPrototypeOf(dict2, null);
|
||||
return dict2;
|
||||
}
|
||||
const mod = await import("./cmudict-BIVBNNNO.js");
|
||||
const dict = mod.default;
|
||||
Object.setPrototypeOf(dict, null);
|
||||
return dict;
|
||||
}, "CMU dictionary");
|
||||
var loadDictionary = loader2.load.bind(loader2);
|
||||
var getDictionary = loader2.get.bind(loader2);
|
||||
var isDictionaryLoaded = loader2.isLoaded.bind(loader2);
|
||||
|
||||
// src/lookup.ts
|
||||
function lookupPronunciation(word) {
|
||||
return lookupPronunciationLower(word.toLowerCase());
|
||||
}
|
||||
function lookupPronunciationLower(key) {
|
||||
const custom = getCustomPronunciation(key);
|
||||
if (custom) {
|
||||
return custom;
|
||||
}
|
||||
const dict = getDictionary();
|
||||
if (!(key in dict)) {
|
||||
return null;
|
||||
}
|
||||
return dict[key];
|
||||
}
|
||||
|
||||
// src/reverse.ts
|
||||
import { stripStress } from "@ingglish/phonemes";
|
||||
var loader3 = createLazyLoader(async () => {
|
||||
const json = await loadJson("reverse-cmudict");
|
||||
let dict;
|
||||
if (json === null) {
|
||||
const mod = await import("./reverse-cmudict-JNRLKABR.js");
|
||||
dict = mod.default;
|
||||
} else {
|
||||
dict = json;
|
||||
}
|
||||
await loadFrequencies();
|
||||
for (const [word, phonemes] of Object.entries(CUSTOM_PRONUNCIATIONS)) {
|
||||
const key = phonemes.map((p) => stripStress(p)).join(" ");
|
||||
const existing = dict[key];
|
||||
if (existing === void 0) {
|
||||
dict[key] = [word];
|
||||
} else if (!existing.includes(word)) {
|
||||
existing.push(word);
|
||||
dict[key] = sortByFrequency(existing);
|
||||
}
|
||||
}
|
||||
return dict;
|
||||
}, "Reverse dictionary");
|
||||
var loadReverseDictionary = loader3.load.bind(loader3);
|
||||
var getReverseDictionary = loader3.get.bind(loader3);
|
||||
function lookupPhonemeKey(key) {
|
||||
return getReverseDictionary()[key];
|
||||
}
|
||||
export {
|
||||
CUSTOM_PRONUNCIATIONS,
|
||||
getCustomPronunciation,
|
||||
getDictionary,
|
||||
getWordFrequency,
|
||||
hasCustomPronunciation,
|
||||
isDictionaryLoaded,
|
||||
loadDictionary,
|
||||
loadFrequencies,
|
||||
loadReverseDictionary,
|
||||
lookupPhonemeKey,
|
||||
lookupPronunciation,
|
||||
lookupPronunciationLower,
|
||||
sortByFrequency
|
||||
};
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// src/reverse-cmudict.js
|
||||
var reverseCmudict = JSON.parse(`{"B AW T":["bout","'bout"],"K AH Z":["'cause"],"K AO R S":["course","coarse","corse","'course"],"K Y UW Z":["cues","ques","queues","q's","q.s","kuse","kuze","q.'s","'cuse"],"AH M":["um","umm","'m","'em"],"F R IH S K OW":["'frisco"],"G EH N":["'gain"],"K EY":["k","kay","cay","k.","khe","'kay","kaye","quaye"],"AH N":["un","'n"],"R AW N D":["round","'round"],"EH S":["s","es","esse","ess","'s","s."],"T IH L":["till","til","'til"],"T IH Z":["tis","'tis"],"T W AH Z":["twas","'twas"],"AH":["a","uh","uhh"],"EY Z":["a's","a.s","a.'s"],"EY":["ay","ae","a."],"EY D IY":["ady","a.d.","adey","eydie"],"EY EH M":["a.m."],"T R IH P AH L EY":["aaa"],"AA B ER G":["aaberg"],"AA K AH N":["aachen"],"AA K AH N ER":["aachener"],"AA K ER":["aaker","ocker"],"AO L B AO R G # place, danish":["aalborg"],"AE L B ER G # place, dutch":["aalburg"],"AE L AH N # place, german":["aalen"],"AA L IY AA":["aaliyah"],"AA L S EH TH":["aalseth"],"AA L S M IH R # place, dutch":["aalsmeer"],"AA L T OW # name, finnish":["aalto"],"AA M AH T":["aamodt"],"AA NG K AO R":["encore","oncor","aancor"],"AA R D EH M AH":["aardema"],"AA R D V AA R K":["aardvark"],"AA R D V AA R K S":["aardvarks"],"AA R G":["argh","aargh"],"AA HH UW S":["aarhus"],"EH R AH N":["aaron","aran","aron","ehren"],"EH R AH N Z":["arens","aarons","aaron's"],"EH R AH N S AH N":["aronson","aaronson"],"EH R AH N S AH N Z":["aaronson's"],"AA R T IY":["arty","aarti","artie"],"AA S":["os","aase"],"AA S AH N":["aasen","osten"],"AE B":["ab"],"EY B IY EY":["aba"],"AH B AA B AH":["ababa"],"AE B AH K AH":["abacha"],"AH B AE K":["aback"],"AE B AH K OW":["abaco"],"AE B AH K AH S":["abacus"],"AH B AA D":["abad"],"AH B AE D AH K AH":["abadaka"],"AH B AE D IY":["abadi","abadie"],"AH B EH R":["abair"],"AH B AA L K IH N":["abalkin"],"AE B AH L OW N IY":["abalone"],"AE B AH L OW N IY Z":["abalones"],"AA B AA L OW Z":["abalos"],"AH B AE N D AH N":["abandon"],"AH B AE N D AH N D":["abandoned"],"AH B AE N D AH N IH NG":["abandoning"],"AH B AE N D AH N M AH N T":["abandonment"],"AH B AE N D AH N M AH N T S":["abandonments"],"AH B AE N D AH N Z":["abandons"],"AH B AE N T OW":["abanto"],"AH B AA R K AH":["abarca"],"AA B AA R IY":["abare"],"AE B AH S K AH L":["abascal"],"AH B AE SH":["abash"],"AH B AE SH T":["abashed"],"AH B EY ZH Y AH":["abasia"],"AH B EY T":["abate"],"AH B EY T IH D":["abated"],"AH B EY T M AH N T":["abatement"],"AH B EY T M AH N T S":["abatements"],"AH B EY T S":["abates"],"AH B EY T IH NG":["abating"],"AE B AH T W AA R":["abattoir"],"AE B AH":["abba"],"AH B AA D OW":["abbado"],"AH B AA S":["abbas"],"AA B AA S IY":["abbasi"],"AA B EY T":["abbate"],"AA B AA T IY EH L OW":["abbatiello"],"AE B IY":["abby","abbey","abbe","abie","abbie"],"AE B AH N HH AW S":["abbenhaus"],"AH B EH T":["abet","abbett"],"AE B V IH L":["abbeville"],"AE B IY Z":["abbey's"],"AE B IH T":["abbitt"],"AE B AH T":["abbott","abbot"],"AE B AH T S T AW N":["abbotstown","abbottstown"],"AE B AH T S":["abbott's"],"AH B UW D":["abood","abboud"],"AH B R IY V IY EY T":["abbreviate"],"AH B R IY V IY EY T IH D":["abbreviated"],"AH B R IY V IY EY T S":["abbreviates"],"AH B R IY V IY EY T IH NG":["abbreviating"],"AH B R IY V IY EY SH AH N":["abbreviation"],"AH B R IY V IY EY SH AH N Z":["abbreviations"],"AA B R UW T S EY Z IY":["abruzzese","abbruzzese"],"AE B Z":["abbs"],"EY B IY S IY":["abc"],"EY B IY S IY Z":["abcs","abc's"],"AE B K OW":["abco"],"AE B K OW T EH K":["abcotek"],"EY B IY D IY":["abd"],"AE B D AE L AH":["abdalla","abdallah"],"AE B D EH L":["abdel"],"AE B D EH L AH":["abdella"],"AE B D AH K EY T":["abdicate"],"AE B D AH K EY T IH D":["abdicated"],"AE B D AH K EY T S":["abdicates"],"AE B D IH K EY T IH NG":["abdicating"],"AE B D IH K EY SH AH N":["abdication"],"AE B D N ER":["abdnor"],"AE B D OW":["abdo"],"AE B D AA L AH":["abdollah"],"AE B D OW M AH N":["abdomen"],"AE B D AA M AH N AH L":["abdominal"],"AE B D AH K T":["abduct"],"AE B D AH K T IH D":["abducted"],"AE B D AH K T IY":["abductee"],"AE B D AH K T IY Z":["abductees"],"AE B D AH K T IH NG":["abducting"],"AE B D AH K SH AH N":["abduction"],"AE B D AH K SH AH N Z":["abductions"],"AE B D AH K T ER":["abductor"],"AE B D AH K T ER Z":["abductors"],"AE B D AH K T S":["abducts"],"AE B D UW L":["abdul"],"AE B D UW L AH Z IY Z":["abdulaziz"],"AA B D UW L AH":["abdulla"],"AE B D AH L AH":["abdullah"],"EY B":["abe"],"AH B EH D":["abed"],"AH B EH D IY":["abedi"],"AH B IY":["abee"],"EY B AH L":["able","abel","abell"],"AA B EH L AH":["abela"],"AE B IH L ER D":["abelard"],"AH B EH L":["abele"],"AH B EH L Z":["abeles"],"AH B EH L AH":["abella"],"AE B IH L N":["abeln"],"AE B AH L OW":["abelow"],"EY B AH L Z":["abels","ables"],"AE B IH L S AH N":["abelson"],"AE B EH N D":["abend"],"AE B IH N D R AO TH":["abendroth"],"EY B ER":["aber","aybar"],"AE B ER K R AA M B IY":["abercrombie"],"AE B ER D IY N":["aberdeen"],"EY B ER F ER D":["aberford"],"AE B ER G":["aberg"],"AE B ER AH L":["aberle"],"AE B ER M IH N":["abermin"],"AE B ER N AE TH IY":["abernathy"],"
Line truncated
|
||||
var reverse_cmudict_default = reverseCmudict;
|
||||
export {
|
||||
reverse_cmudict_default as default
|
||||
};
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// src/data/word-frequencies.js
|
||||
var WORD_FREQUENCIES = JSON.parse(`{"you":2134713,"I":2038529,"the":1501908,"to":1156570,"s":1057301,"a":1041179,"it":963712,"t":733338,"that":719677,"and":682780,"of":590439,"What":501965,"in":498444,"me":471339,"is":459663,"we":459607,"this":406915,"he":389497,"on":354742,"for":351650,"my":344899,"m":343245,"your":328715,"don":321085,"have":314232,"do":312915,"re":311072,"No":304549,"be":293085,"know":291780,"was":288391,"not":276673,"can":267620,"are":265672,"all":263255,"with":257465,"just":242206,"get":233772,"here":230788,"but":225291,"ll":224097,"there":221754,"so":216452,"they":209250,"right":204428,"like":203947,"out":197131,"go":193445,"she":190377,"up":187170,"about":185206,"if":180610,"him":177710,"got":168631,"Oh":167781,"at":164072,"now":163333,"Come":160190,"one":156684,"How":155867,"Well":152523,"Yeah":152262,"her":144627,"want":140718,"think":137261,"good":133117,"see":130393,"Let":123381,"did":119410,"Why":114687,"who":113370,"as":113068,"his":108364,"will":108306,"going":108288,"from":103992,"when":103739,"back":102467,"Okay":102320,"Yes":101835,"gonna":101804,"d":101335,"time":99890,"look":99311,"take":96443,"an":95071,"man":94133,"Where":93341,"them":90720,"would":90162,"been":88573,"some":88089,"Hey":88079,"tell":87949,"or":86970,"us":86478,"had":85472,"were":84804,"say":83629,"could":83109,"didn":80623,"something":76508,"really":76508,"down":76004,"then":75966,"little":73766,"way":72661,"our":71425,"make":70775,"too":69950,"never":69490,"by":68364,"over":67488,"more":66228,"need":66040,"mean":63443,"very":63304,"off":60155,"Mr":60098,"sorry":59566,"give":59559,"has":57830,"Thank":56877,"love":56864,"said":56531,"am":56438,"people":56252,"please":56149,"sure":56091,"any":56068,"thing":55522,"only":55269,"because":54622,"two":54384,"should":54159,"doing":52492,"much":49636,"sir":49188,"Maybe":47249,"help":46977,"anything":46270,"these":46104,"God":46061,"even":44672,"night":44168,"call":43931,"talk":43605,"nothing":43534,"into":43074,"first":42869,"find":42379,"wait":42343,"put":42251,"great":41864,"thought":41232,"day":40893,"work":40699,"life":40629,"before":40501,"better":40494,"again":40428,"still":40225,"home":39491,"guy":38893,"won":38729,"those":38404,"than":37679,"around":37573,"other":37505,"away":37276,"new":36913,"last":36878,"uh":36579,"ever":36170,"stop":36071,"keep":35846,"told":35679,"must":35661,"things":35337,"big":34824,"after":34812,"long":34433,"does":34002,"always":33418,"their":33413,"everything":33399,"nice":33125,"name":32735,"money":32679,"doesn":32435,"guys":32198,"feel":31989,"believe":31882,"Thanks":31789,"old":31056,"place":30736,"fine":30502,"kind":30125,"isn":29886,"Hello":29857,"lot":29066,"years":29003,"made":28626,"leave":28596,"Hi":28464,"girl":28413,"hear":28323,"father":28279,"through":28026,"every":28007,"bad":27804,"Listen":27784,"remember":27666,"three":27654,"boy":27021,"coming":26878,"wrong":26678,"might":26334,"stay":26298,"house":26214,"may":26080,"baby":25978,"another":25970,"Ok":25928,"Dad":25870,"gotta":25852,"wanna":25796,"wanted":25616,"enough":25568,"talking":25385,"happened":24994,"show":24906,"course":24848,"being":24781,"care":24748,"done":24737,"getting":24719,"mind":24715,"left":24707,"ask":24640,"car":24636,"understand":24605,"mother":24476,"which":24339,"try":24314,"shit":24207,"hell":24012,"Miss":23850,"came":23650,"wouldn":23628,"own":23419,"world":23216,"guess":23153,"next":23090,"kill":23081,"else":22907,"dead":22898,"trying":22849,"someone":22752,"real":22583,"room":22415,"morning":22389,"huh":22350,"hold":22273,"ain":22248,"woman":22166,"yourself":22151,"today":22124,"looking":22066,"wasn":21984,"Mom":21950,"friend":21384,"move":21325,"same":21276,"job":21063,"tonight":21047,"went":20987,"son":20949,"best":20623,"saw":20527,"found":20196,"pretty":20003,"ready":19778,"heard":19775,"whole":19660,"seen":19633,"together":19553,"fuck":19307,"minute":19252,"men":19011,"head":18947,"matter":18900,"haven":18844,"knew":18817,"Excuse":18773,"many":18331,"idea":18311,"without":18087,"play":18081,"family":18067,"meet":17966,"most":17889,"run":17878,"while":17821,"wife":17795,"once":17589,"live":17574,"somebody":17571,"everybody":17555,"used":17551,"use":17536,"myself":17470,"took":17454,"yet":17428,"start":17345,"called":17341,"couldn":17336,"kid":17299,"tomorrow":17134,"happy":16993,"school":16989,"problem":16833,"watch":16831,"bring":16685,"fucking":16603,"actually":16439,"business":16371,"says":16356,"hope":16352,"open":16341,"already":16246,"since":16064,"looks":15886,"sit":15879,"Mrs":15858,"cause":15812,"alone":15735,"hard":15700,"wants":15655,"stuff":15653,"turn":15630,"days":15592,"friends":15578,"until":15426,"few":15393,"kids":15356,"honey":15325,"Dr":15194,"gone":15135,"both":15062,"door":14895,"later":14889,"saying":14874,"such":14852,"killed":14792,"having":14752,"face":14747,"worry":14638,"ago":14592,"five":14558,"second":14513,"brother":14481,"damn":14460,"case":14403,"thinking":14353,"probably":14323,"beautiful":14266,"
Line truncated
|
||||
var word_frequencies_default = WORD_FREQUENCIES;
|
||||
export {
|
||||
word_frequencies_default as default
|
||||
};
|
||||
Reference in new issue
Block a user