Added word blacklist for lowercase names. Improved definition curation.
This commit is contained in:
parent
f46d5f008b
commit
234bbb2bbc
|
@ -39,7 +39,16 @@ async function init() {
|
|||
const sortedWords = validWords.reduce((acc, [rawWord, fullDefinition]) => {
|
||||
const word = rawWord.toLowerCase();
|
||||
const anagram = word.split('').sort().join('');
|
||||
const definitions = fullDefinition?.split(/\d+\.\s+/).filter(Boolean).map((definition) => definition.split('.')[0].toLowerCase()) || [];
|
||||
const definitions = fullDefinition
|
||||
?.split(/\d+\.\s+/).filter(Boolean).map((definition) => {
|
||||
const splitIndex = definition.indexOf('.', 16); // split after n characters to avoid splitting on e.g. abbreviated categories at the start of the definition: (Anat.)
|
||||
|
||||
if (splitIndex > -1) {
|
||||
return definition.slice(0, splitIndex).trim().toLowerCase();
|
||||
}
|
||||
|
||||
return definition.toLowerCase();
|
||||
}) || [];
|
||||
|
||||
if (!acc[anagram.length]) {
|
||||
acc[anagram.length] = {};
|
||||
|
|
|
@ -4929,6 +4929,7 @@
|
|||
"barkers": "1. An animal that barks; hence, any one who clamors unreasonably. 2. One who stands at the doors of shops to urg [Cant, Eng.] 3. A pistol. [Slang] Dickens. 4. (Zoöl.) The spotted redshank.\n\nOne who strips trees of their bark. BARKER'S MILL Bark\"er's mill`. Etym: [From Dr. Barker, the inventor.] A machine, invented in the 17th century, worked by a form of reaction wheel. The water flows into a vertical tube and gushes from apertures in hollow horizontal arms, causing the machine to revolve on its axis.",
|
||||
"barking": null,
|
||||
"barks": "1. To strip the bark from; to peel. 2. To abrade or rub off any outer covering from; as to bark one's heel. 3. To girdle. See Girdle, v. t., 3. 4. To cover or inclose with bark, or as with bark; as, to bark the roof of a hut.\n\n1. To make a short, loud, explosive noise with the vocal organs; -- said of some animals, but especially of dogs. 2. To make a clamor; to make importunate outcries. They bark, and say the Scripture maketh heretics. Tyndale. Where there is the barking of the belly, there no other commands will be heard, much less obeyed. Fuller.\n\nThe short, loud, explosive sound uttered by a dog; a similar sound made by some other animals.\n\n1. Formerly, any small sailing vessel, as a pinnace, fishing smack, etc.; also, a rowing boat; a barge. Now applied poetically to a sailing vessel or boat of any kind. Byron. 2. (Naut.) A three-masted vessel, having her foremast and mainmast squarerigged, and her mizzenmast schooner-rigged.",
|
||||
"barky": "Covered with, or containing, bark. \"The barky fingers of the elm.\" Shak.",
|
||||
"barley": "A valuable grain, of the family of grasses, genus Hordeum, used for food, and for making malt, from which are prepared beer, ale, and whisky. Barley bird (Zoöl.), the siskin. -- Barley sugar, sugar boiled till it is brittle (formerly with a decoction of barley) and candied. -- Barley water, a decoction of barley, used in medicine, as a nutritive and demulcent.",
|
||||
"barmaid": "A girl or woman who attends the customers of a bar, as in a tavern or beershop. A bouncing barmaid. W. Irving.",
|
||||
"barmaids": "A girl or woman who attends the customers of a bar, as in a tavern or beershop. A bouncing barmaid. W. Irving.",
|
||||
|
@ -11210,6 +11211,7 @@
|
|||
"chocolates": "1. A paste or cake composed of the roasted seeds of the Theobroma Cacao ground and mixed with other ingredients, usually sugar, and cinnamon or vanilla. 2. The beverage made by dissolving a portion of the paste or cake in boiling water or milk. Chocolate house, a house in which customers may be served with chocolate. -- Chocolate nut. See Cacao.",
|
||||
"chocolaty": null,
|
||||
"chocs": null,
|
||||
"chode": "the old imp. of chide. See Chide.",
|
||||
"choice": "1. Act of choosing; the voluntary act of selecting or separating from two or more things that which is preferred; the determination of the mind in preferring one thing to another; election. 2. The power or opportunity of choosing; option. Choice there is not, unless the thing which we take be so in our power that we might have refused it. Hooker. 3. Care in selecting; judgment or skill in distinguishing what is to be preferred, and in giving a preference; discrimination. I imagine they [the apothegms of Cæsar] were collected with judgment and choice. Bacon. 4. A sufficient number to choose among. Shak. 5. The thing or person chosen; that which is approved and selected in preference to others; selection. The common wealth is sick of their own choice. Shak. 6. The best part; that which is preferable. The flower and choice Of many provinces from bound to bound. Milton. To make a choice of, to choose; to select; to separate and take in preference. Syn. - See Volition, Option.\n\n1. Worthly of being chosen or preferred; select; superior; precious; valuable. My choicest hours of life are lost. Swift. 2. Preserving or using with care, as valuable; frugal; -- used with of; as, to be choice of time, or of money. 3. Selected with care, and due attention to preference; deliberately chosen. Choice word measured phrase. Wordsworth. Syn. - Select; precious; exquisite; uncommon; rare; chary; careful/",
|
||||
"choicer": null,
|
||||
"choices": "1. Act of choosing; the voluntary act of selecting or separating from two or more things that which is preferred; the determination of the mind in preferring one thing to another; election. 2. The power or opportunity of choosing; option. Choice there is not, unless the thing which we take be so in our power that we might have refused it. Hooker. 3. Care in selecting; judgment or skill in distinguishing what is to be preferred, and in giving a preference; discrimination. I imagine they [the apothegms of Cæsar] were collected with judgment and choice. Bacon. 4. A sufficient number to choose among. Shak. 5. The thing or person chosen; that which is approved and selected in preference to others; selection. The common wealth is sick of their own choice. Shak. 6. The best part; that which is preferable. The flower and choice Of many provinces from bound to bound. Milton. To make a choice of, to choose; to select; to separate and take in preference. Syn. - See Volition, Option.\n\n1. Worthly of being chosen or preferred; select; superior; precious; valuable. My choicest hours of life are lost. Swift. 2. Preserving or using with care, as valuable; frugal; -- used with of; as, to be choice of time, or of money. 3. Selected with care, and due attention to preference; deliberately chosen. Choice word measured phrase. Wordsworth. Syn. - Select; precious; exquisite; uncommon; rare; chary; careful/",
|
||||
|
@ -36136,7 +36138,6 @@
|
|||
"inward": "1. Being or placed within; inner; interior; -- opposed to outward. Milton. 2. Seated in the mind, heart, spirit, or soul. \"Inward beauty.\" Shak. 3. Intimate; domestic; private. [Obs.] All my inward friends abhorred me. Job xix. 19. He had had occasion, by one very inward with him, to know in part the discourse of his life. Sir P. Sidney.\n\n1. That which is inward or within; especially, in the plural, the inner parts or organs of the body; the viscera. Jer. Taylor. Then sacrificing, laid the inwards and their fat. Milton. 2. The mental faculties; -- usually pl. [Obs.] 3. An intimate or familiar friend or acquaintance. [Obs.] \"I was an inward of his.\" Shak.\n\n1. Toward the inside; toward the center or interior; as, to bend a thing inward. 2. Into, or toward, the mind or thoughts; inwardly; as, to turn the attention inward. So much the rather, thou Celestial Light, Shine inward. Milton.",
|
||||
"inwardly": "1. In the inner parts; internally. Let Benedick, like covered fire, Consume away in sighs, waste inwardly. Shak. 2. Toward the center; inward; as, to curve inwardly. 3. In the heart or mind; mentally; privately; secretas, he inwardly repines. 4. Intimately; thoroughly. [Obs.] I shall desire to know him more inwardly. Beau. & Fl.",
|
||||
"inwards": "1. Toward the inside; toward the center or interior; as, to bend a thing inward. 2. Into, or toward, the mind or thoughts; inwardly; as, to turn the attention inward. So much the rather, thou Celestial Light, Shine inward. Milton.\n\nSee Inward.",
|
||||
"ioctl": null,
|
||||
"iodide": "A binary compound of iodine, or one which may be regarded as binary; as, potassium iodide.",
|
||||
"iodides": "A binary compound of iodine, or one which may be regarded as binary; as, potassium iodide.",
|
||||
"iodine": "A nonmetallic element, of the halogen group, occurring always in combination, as in the iodides. When isolated it is in the form of dark gray metallic scales, resembling plumbago, soft but brittle, and emitting a chlorinelike odor. Symbol I. Atomic weight 126.5. If heated, iodine volatilizes in beautiful violet vapors. Note: Iodine was formerly obtained from the ashes of seaweed (kelp or varec), but is now also extracted from certain natural brines. In the free state, iodine, even in very minute quantities, colors starch blue. Iodine and its compounds are largely used in medicine (as in liniments, antisyphilitics, etc.), in photography, in the preparation of aniline dyes, and as an indicator in titration. Iodine green, an artificial green dyestuff, consisting of an iodine derivative of rosaniline; -- called also night green. -- Iodine scarlet, a pigment of an intense scarlet color, consisting of mercuric iodide. -- Iodine yellow, a brilliant yellow pigment, consisting of plumbic iodide.",
|
||||
|
@ -77544,7 +77545,6 @@
|
|||
"xor": null,
|
||||
"xref": null,
|
||||
"xrefs": null,
|
||||
"xterm": null,
|
||||
"xylem": "That portion of a fibrovascular bundle which has developed, or will develop, into wood cells; -- distinguished from phloëm.",
|
||||
"xylene": "Any of a group of three metameric hydrocarbons of the aromatic series, found in coal and wood tar, and so named because found in crude wood spirit. They are colorless, oily, inflammable liquids, C6H4.(CH3)2, being dimethyl benzenes, and are called respectively orthoxylene, metaxylene, and paraxylene. Called also xylol. Note: Each of these xylenes is the nucleus and prototype of a distinct series of compounds.",
|
||||
"xylophone": "1. (Mus.) An instrument common among the Russians, Poles, and Tartars, consisting of a series of strips of wood or glass graduated in length to the musical scale, resting on belts of straw, and struck with two small hammers. Called in Germany strohfiedel, or straw fiddle. 2. An instrument to determine the vibrative properties of different kinds of wood. Knight.",
|
||||
|
|
|
@ -3,18 +3,14 @@
|
|||
const fs = require('fs').promises;
|
||||
|
||||
const words = require('./words.json');
|
||||
const dictionary = require('./dictionary_old.json');
|
||||
const wordsBlacklist = require('./words_blacklist.json');
|
||||
const dictionary = require('./dictionary.json');
|
||||
|
||||
// mainly lowercase names
|
||||
const blacklist = new Set(wordsBlacklist);
|
||||
|
||||
async function init() {
|
||||
const notNameWords = words.filter((word) => word.charAt(0) === word.charAt(0).toLowerCase()); // don't include names for places, products, people, etc.
|
||||
|
||||
/*
|
||||
words.forEach((word) => {
|
||||
if (word.charAt(0) === word.charAt(0).toUpperCase()) {
|
||||
console.log(word);
|
||||
}
|
||||
});
|
||||
*/
|
||||
const notNameWords = words.filter((word) => word.charAt(0) === word.charAt(0).toLowerCase() && !blacklist.has(word)); // don't include names for places, products, people, etc.
|
||||
|
||||
const definitions = Object.fromEntries(notNameWords.map((word) => {
|
||||
const normalizedWord = word.normalize('NFD').replace(/\p{Diacritic}/ug, '').toLowerCase().trim();
|
||||
|
|
|
@ -5934,6 +5934,7 @@
|
|||
"barking",
|
||||
"Barkley",
|
||||
"barks",
|
||||
"barky",
|
||||
"barley",
|
||||
"Barlow",
|
||||
"barmaid",
|
||||
|
@ -13436,6 +13437,7 @@
|
|||
"chocs",
|
||||
"Choctaw",
|
||||
"Choctaws",
|
||||
"chode",
|
||||
"choice",
|
||||
"choicer",
|
||||
"choices",
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[
|
||||
"ioctl",
|
||||
"xterm"
|
||||
]
|
Loading…
Reference in New Issue