/**
* Tricky words resource - words that LLMs commonly miscount
*/
export interface TrickyWord {
word: string;
letter: string;
count: number;
positions: number[];
common_mistake: number;
explanation: string;
}
export const TRICKY_WORDS: TrickyWord[] = [
{
word: "strawberry",
letter: "r",
count: 3,
positions: [2, 7, 8],
common_mistake: 2,
explanation: "The 'r' appears three times: st[r]awbe[r][r]y. LLMs often miss the double 'r' at the end.",
},
{
word: "raspberry",
letter: "r",
count: 3,
positions: [0, 6, 7],
common_mistake: 2,
explanation: "Three 'r's: [r]aspbe[r][r]y. The double 'r' near the end is often missed.",
},
{
word: "occurrence",
letter: "r",
count: 2,
positions: [4, 5],
common_mistake: 1,
explanation: "Two consecutive 'r's: occu[r][r]ence. Easy to count as one.",
},
{
word: "occurrence",
letter: "c",
count: 3,
positions: [1, 2, 8],
common_mistake: 2,
explanation: "Three 'c's: o[c][c]urren[c]e. The double 'c' at the start plus one later.",
},
{
word: "necessary",
letter: "s",
count: 2,
positions: [4, 5],
common_mistake: 1,
explanation: "Two consecutive 's's: nece[s][s]ary.",
},
{
word: "accommodation",
letter: "m",
count: 2,
positions: [4, 5],
common_mistake: 1,
explanation: "Two 'm's together: acco[m][m]odation.",
},
{
word: "mississippi",
letter: "s",
count: 4,
positions: [2, 3, 5, 6],
common_mistake: 3,
explanation: "Four 's's in pairs: mi[s][s]i[s][s]ippi.",
},
{
word: "mississippi",
letter: "i",
count: 4,
positions: [1, 4, 7, 10],
common_mistake: 3,
explanation: "Four 'i's spread throughout: m[i]ss[i]ss[i]pp[i].",
},
{
word: "mississippi",
letter: "p",
count: 2,
positions: [8, 9],
common_mistake: 1,
explanation: "Two 'p's together: mississi[p][p]i.",
},
{
word: "entrepreneurship",
letter: "r",
count: 3,
positions: [3, 6, 11],
common_mistake: 2,
explanation: "Three 'r's: ent[r]ep[r]eneu[r]ship. Spread across a long word.",
},
{
word: "programming",
letter: "r",
count: 2,
positions: [1, 4],
common_mistake: 1,
explanation: "Two 'r's: p[r]og[r]amming.",
},
{
word: "programming",
letter: "m",
count: 2,
positions: [6, 7],
common_mistake: 1,
explanation: "Two 'm's together: program[m][m]ing.",
},
{
word: "banana",
letter: "a",
count: 3,
positions: [1, 3, 5],
common_mistake: 2,
explanation: "Three 'a's: b[a]n[a]n[a]. The repeating pattern can confuse.",
},
{
word: "assessment",
letter: "s",
count: 4,
positions: [1, 2, 4, 5],
common_mistake: 3,
explanation: "Four 's's in two pairs: a[s][s]e[s][s]ment.",
},
{
word: "committee",
letter: "m",
count: 2,
positions: [2, 3],
common_mistake: 1,
explanation: "Two 'm's: co[m][m]ittee.",
},
{
word: "committee",
letter: "t",
count: 2,
positions: [5, 6],
common_mistake: 1,
explanation: "Two 't's: commi[t][t]ee.",
},
{
word: "committee",
letter: "e",
count: 2,
positions: [7, 8],
common_mistake: 1,
explanation: "Two 'e's at the end: committ[e][e].",
},
{
word: "bookkeeper",
letter: "o",
count: 2,
positions: [1, 2],
common_mistake: 1,
explanation: "Two 'o's: b[o][o]kkeeper.",
},
{
word: "bookkeeper",
letter: "k",
count: 2,
positions: [3, 4],
common_mistake: 1,
explanation: "Two 'k's: boo[k][k]eeper.",
},
{
word: "bookkeeper",
letter: "e",
count: 3,
positions: [5, 6, 8],
common_mistake: 2,
explanation: "Three 'e's: bookk[e][e]p[e]r.",
},
];
export interface TrickyWordsOutput {
total_words: number;
words: TrickyWord[];
categories: {
double_letters: TrickyWord[];
triple_or_more: TrickyWord[];
};
}
export function getTrickyWords(): TrickyWordsOutput {
const double_letters = TRICKY_WORDS.filter(w => w.count === 2);
const triple_or_more = TRICKY_WORDS.filter(w => w.count >= 3);
return {
total_words: TRICKY_WORDS.length,
words: TRICKY_WORDS,
categories: {
double_letters,
triple_or_more,
},
};
}
export function getTrickyWordByName(word: string): TrickyWord[] {
return TRICKY_WORDS.filter(w => w.word.toLowerCase() === word.toLowerCase());
}