[{"data":1,"prerenderedAt":611,"buildId":612},["ShallowReactive",2],{"docs:\u002Fguide\u002Fcorpus":3},{"page":4,"section":16,"document":17,"credits":10,"prev":605,"next":609},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"corpus","\u002Fguide\u002Fcorpus","guide\u002Fcorpus.md","The corpus","Define your glosslint corpus in glosslint.config.ts, combine presets and glossary tables, allow phrases, and control merge order.",null,[],"i-lucide-book-marked","article",true,3,"guide",{"nodes":18,"toc":599},[19,28,36,55,354,383,389,502,508,526,534,544,549,560],[20,21,22,23,27],"p",{},"Your corpus holds every term, description, avoid word, and casing rule for your product. Put it in ",[24,25,26],"code",{},"glosslint.config.ts"," at the root of your project when you set up glosslint or add new rules. ESLint, x18n, and the CLI all read the same exported corpus.",[29,30,35],"h2",{"id":31,"anchor":32},"defining-a-corpus",{"label":33,"icon":34},"Section titled \"Defining a corpus\"","#","Defining a corpus",[20,37,38,39,44,45,49,50,54],{},"A corpus can extend built-in ",[40,41,43],"a",{"href":42},"\u002Fguide\u002Fpresets","presets",", read terms from a Markdown ",[40,46,48],{"href":47},"\u002Fguide\u002Fglossary-table","glossary table",", and add project-specific ",[40,51,53],{"href":52},"\u002Fguide\u002Fterms","terms"," of its own. Here is a full config for a bike-share app:",[56,57,60],"pre",{"language":58,"filename":26,"class":59},"ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,61,63,86,87,86,101,86,115,86,117,86,133,86,173,86,178,86,183,86,193,86,203,86,213,86,236,86,253,86,270,86,275,86,286,86,301,86,322,86,329,86,347],{"class":62},"language-ts",[64,65,68,72,76,79,83],"span",{"class":66,"style":67},"line","display: inline",[64,69,71],{"style":70},"color:#CF222E;--shiki-dark:#FF7B72","import",[64,73,75],{"style":74},"color:#1F2328;--shiki-dark:#E6EDF3"," { defineCorpus, fromGlossaryTable } ",[64,77,78],{"style":70},"from",[64,80,82],{"style":81},"color:#0A3069;--shiki-dark:#A5D6FF"," \"glosslint\"",[64,84,85],{"style":74},";","\n",[64,88,89,91,94,96,99],{"class":66,"style":67},[64,90,71],{"style":70},[64,92,93],{"style":74}," inclusive ",[64,95,78],{"style":70},[64,97,98],{"style":81}," \"glosslint\u002Fpresets\u002Finclusive\"",[64,100,85],{"style":74},[64,102,103,105,108,110,113],{"class":66,"style":67},[64,104,71],{"style":70},[64,106,107],{"style":74}," tech ",[64,109,78],{"style":70},[64,111,112],{"style":81}," \"glosslint\u002Fpresets\u002Ftech\"",[64,114,85],{"style":74},[64,116],{"class":66,"style":67},[64,118,119,122,125,129],{"class":66,"style":67},[64,120,121],{"style":70},"export",[64,123,124],{"style":70}," default",[64,126,128],{"style":127},"color:#8250DF;--shiki-dark:#D2A8FF"," defineCorpus",[64,130,132],{"style":131},"color:#953800;--shiki-dark:#FFA657","({",[64,134,135,138,141,144,147,150,152,155,158,160,163,167,170],{"class":66,"style":67},[64,136,137],{"style":74},"  extends: [tech, inclusive, ",[64,139,140],{"style":127},"fromGlossaryTable",[64,142,143],{"style":74},"(",[64,145,146],{"style":70},"new",[64,148,149],{"style":127}," URL",[64,151,143],{"style":74},[64,153,154],{"style":81},"\".\u002Fdocs\u002Fglossary.md\"",[64,156,157],{"style":74},", ",[64,159,71],{"style":70},[64,161,162],{"style":74},".",[64,164,166],{"style":165},"color:#0550AE;--shiki-dark:#79C0FF","meta",[64,168,169],{"style":74},".url))]",[64,171,172],{"style":131},",",[64,174,175],{"class":66,"style":67},[64,176,177],{"style":74},"  terms: [",[64,179,180],{"class":66,"style":67},[64,181,182],{"style":74},"    {",[64,184,185,188,191],{"class":66,"style":67},[64,186,187],{"style":74},"      term: ",[64,189,190],{"style":81},"\"Dock\"",[64,192,172],{"style":74},[64,194,195,198,201],{"class":66,"style":67},[64,196,197],{"style":74},"      description: ",[64,199,200],{"style":81},"\"A powered stand where one bike is locked.\"",[64,202,172],{"style":74},[64,204,205,208,211],{"class":66,"style":67},[64,206,207],{"style":74},"      nuance: ",[64,209,210],{"style":81},"\"A station is a group of docks.\"",[64,212,172],{"style":74},[64,214,215,218,221,224,227,230,233],{"class":66,"style":67},[64,216,217],{"style":74},"      avoid: [{ word: ",[64,219,220],{"style":81},"\"rack\"",[64,222,223],{"style":74},", why: ",[64,225,226],{"style":81},"\"Racks are unpowered.\"",[64,228,229],{"style":74}," }, ",[64,231,232],{"style":81},"\"bay\"",[64,234,235],{"style":74},"],",[64,237,238,241,244,247,250],{"class":66,"style":67},[64,239,240],{"style":74},"      examples: { good: [",[64,242,243],{"style":81},"\"Return the bike to any dock\"",[64,245,246],{"style":74},"], bad: [",[64,248,249],{"style":81},"\"Return the bike to any rack\"",[64,251,252],{"style":74},"] },",[64,254,255,258,261,264,267],{"class":66,"style":67},[64,256,257],{"style":74},"      links: [{ title: ",[64,259,260],{"style":81},"\"Docks\"",[64,262,263],{"style":74},", url: ",[64,265,266],{"style":81},"\"https:\u002F\u002Fexample.com\u002Fdocs\u002Fdocks\"",[64,268,269],{"style":74}," }],",[64,271,272],{"class":66,"style":67},[64,273,274],{"style":74},"    },",[64,276,277,280,283],{"class":66,"style":67},[64,278,279],{"style":74},"    { term: ",[64,281,282],{"style":81},"\"Checkout\"",[64,284,285],{"style":74}," },",[64,287,288,290,293,296,299],{"class":66,"style":67},[64,289,279],{"style":74},[64,291,292],{"style":81},"\"eBike\"",[64,294,295],{"style":74},", case: ",[64,297,298],{"style":81},"\"exact\"",[64,300,285],{"style":74},[64,302,303,305,308,311,314,317,320],{"class":66,"style":67},[64,304,279],{"style":74},[64,306,307],{"style":81},"\"Day Pass\"",[64,309,310],{"style":74},", abbr: [",[64,312,313],{"style":81},"\"DP\"",[64,315,316],{"style":74},"], case: ",[64,318,319],{"style":81},"\"context\"",[64,321,285],{"style":74},[64,323,324,327],{"class":66,"style":67},[64,325,326],{"style":74},"  ]",[64,328,172],{"style":131},[64,330,331,334,337,339,342,345],{"class":66,"style":67},[64,332,333],{"style":74},"  allow: [",[64,335,336],{"style":81},"\"check out our\"",[64,338,157],{"style":74},[64,340,341],{"style":81},"\"roof rack\"",[64,343,344],{"style":74},"]",[64,346,172],{"style":131},[64,348,349,352],{"class":66,"style":67},[64,350,351],{"style":131},"})",[64,353,85],{"style":74},[20,355,356,359,360,363,364,368,369,157,373,377,378,382],{},[24,357,358],{},"defineCorpus"," checks every field when the config loads and throws a ",[24,361,362],{},"GlosslintConfigError"," on a mistake, as ",[40,365,367],{"href":366},"\u002Freference\u002Fconfig-errors","Config errors"," lists. It returns a flat corpus that ",[40,370,372],{"href":371},"\u002Fintegrations\u002Feslint","ESLint",[40,374,376],{"href":375},"\u002Fintegrations\u002Fx18n","x18n",", and the ",[40,379,381],{"href":380},"\u002Fintegrations\u002Fcli","CLI"," all read.",[29,384,388],{"id":385,"anchor":386},"corpus-fields",{"label":387,"icon":34},"Section titled \"Corpus fields\"","Corpus fields",[390,391,392,405],"table",{},[393,394,395],"thead",{},[396,397,398,402],"tr",{},[399,400,401],"th",{},"Field",[399,403,404],{},"What it does",[406,407,408,433,445,463,484],"tbody",{},[396,409,410,416],{},[411,412,413],"td",{},[24,414,415],{},"extends",[411,417,418,419,157,421,424,425,428,429,162],{},"Corpora to merge in first: ",[40,420,43],{"href":42},[24,422,423],{},"fromGlossaryTable(...)",", or another ",[24,426,427],{},"defineCorpus(...)",". See ",[40,430,432],{"href":431},"#merge-order","Merge order",[396,434,435,439],{},[411,436,437],{},[24,438,53],{},[411,440,441,442,162],{},"Your own terms. See ",[40,443,444],{"href":52},"Defining terms",[396,446,447,452],{},[411,448,449],{},[24,450,451],{},"allow",[411,453,454,455,458,459,462],{},"Phrases that are never reported. A finding that sits inside an allowed phrase is dropped. Words in a phrase match across spaces, hyphens and underscores, and a plural ",[24,456,457],{},"s"," or ",[24,460,461],{},"es"," matches too.",[396,464,465,470],{},[411,466,467],{},[24,468,469],{},"casing",[411,471,472,473,476,477,428,480,162],{},"The case style of ",[24,474,475],{},"context"," terms per kind of text: ",[24,478,479],{},"{ label, header, sentence }",[40,481,483],{"href":482},"\u002Fguide\u002Fcasing","Casing rules",[396,485,486,491],{},[411,487,488],{},[24,489,490],{},"wholeLabel",[411,492,493,496,497,499,500,162],{},[24,494,495],{},"true"," to check every word of a label or header that holds a ",[24,498,475],{}," term, not only the term. See ",[40,501,483],{"href":482},[29,503,507],{"id":504,"anchor":505},"allowing-phrases",{"label":506,"icon":34},"Section titled \"Allowing phrases\"","Allowing phrases",[20,509,510,512,513,516,517,519,520,522,523,525],{},[24,511,451],{}," handles a word that has a second meaning. In the config above, ",[24,514,515],{},"rack"," is an avoid word for Dock, but \"roof rack\" is a different thing, so ",[24,518,341],{}," goes in ",[24,521,451],{},". The same applies to ",[24,524,336],{},", which is a verb phrase and not the noun Checkout.",[20,527,528,529,458,531,533],{},"When glosslint finds a problem whose text sits inside an allowed phrase, it drops that finding. Words in an allowed phrase match across spaces, hyphens, and underscores, and plurals ending in ",[24,530,457],{},[24,532,461],{}," match too.",[535,536,539],"github-callout",{"type":537,"title":538},"tip","Tip",[20,540,541,542,162],{},"To switch off a term from a preset, add its spellings to ",[24,543,451],{},[29,545,432],{"id":546,"anchor":547},"merge-order",{"label":548,"icon":34},"Section titled \"Merge order\"",[20,550,551,552,555,556,559],{},"glosslint merges terms by key. A key is the term's words joined and lowercased, letters and digits only. For example, ",[24,553,554],{},"\"Re-charge point\""," and ",[24,557,558],{},"\"recharge point\""," share the same key.",[561,562,563,573,588,591],"ol",{},[564,565,566,567,569,570,572],"li",{},"glosslint reads ",[24,568,415],{}," from left to right. A later corpus replaces an earlier term with the same key. In the config above, a term from the ",[40,571,48],{"href":47}," replaces a preset term with the same words.",[564,574,575,576,578,579,581,582,585,586,162],{},"The corpus's own ",[24,577,53],{}," replace every term from ",[24,580,415],{}," with the same key. Two of your own terms with the same key throw ",[24,583,584],{},"GLOSSLINT_C005",", listed in ",[40,587,367],{"href":366},[564,589,590],{},"A term is replaced whole. Fields are not merged.",[564,592,593,595,596,598],{},[24,594,451],{}," lists add up, with every ",[24,597,415],{}," entry's list first and then your own.",[600,602,603,604],{"id":31,"depth":601,"text":35},2,{"id":385,"depth":601,"text":388},{"id":504,"depth":601,"text":507},{"id":546,"depth":601,"text":432},{"path":606,"title":607,"description":608},"\u002Fguide\u002Finstallation","Installation","Install glosslint, check the Node 22.18 and optional peer requirements, write your first glosslint.config.ts, and run check and test.",{"path":52,"title":444,"description":610},"Configure glosslint terms with descriptions, nuance, avoid words, abbreviations, casing options, locale forms, and inline test examples.",1795627930058,"94d466e2-147b-430f-b5f0-25c6a986e462"]