1
0
Fork 0
cookiedb/userscripts/thalia_lib.ts

289 Zeilen
6.7 KiB
TypeScript

class TrieNode {
children: Map<string, TrieNode>;
isEndOfWord: boolean;
constructor() {
this.children = new Map<string, TrieNode>();
this.isEndOfWord = false;
}
}
class Trie {
root: TrieNode;
constructor(inputs: string[] = []) {
this.root = new TrieNode();
for (const item of inputs) {
this.insert(item.toLowerCase());
}
}
insert(word: string) {
let node = this.root;
for (const char of word) {
if (!node.children.has(char)) {
node.children.set(char, new TrieNode());
}
node = node.children.get(char)!;
}
node.isEndOfWord = true;
}
startsWith(word: string) {
let node = this.root;
for (const char of word) {
if (!node.children.has(char)) {
return false;
}
node = node.children.get(char)!;
if (node.isEndOfWord) {
return true;
}
}
return true;
}
}
const trie = new Trie([
2024-05-01 07:59:17 +00:00
"Manga for success",
"Fairy Tail",
"TeddyBoys",
"Cold - die Kreatur",
"Kampf der verführergiganten",
"Berserk",
"Kakegurui Twin",
"Dem Himmel zu fern",
"Drache &amp; Chamäleon",
"Die Tänzerin des Königs",
"ab sofort schwester!",
"Himmelblaue Zeiten",
"How to train a newbie",
"Ripper",
2024-05-01 07:59:17 +00:00
"Café Liebe",
"D.N. Angel",
"Charon",
"Go! Go! Loser Ranger",
"after school",
"alice in borderland",
"alice und die halbbluthexe",
"and then i know love",
"and then i love you",
"angels of death",
"anyway, i love you",
"arifureta - der kampf zurück in meine welt",
"auf und ab",
"bakemonogatari",
"beast after school",
"birds of shangri-la",
"bitter playmate",
"black butler",
"bloody bites at boarding school",
"blue eye lie",
"boruto",
"canis",
"crossing borders",
"das band der unterwelt",
"das kind, das ich in meinen träumen sah",
"das opfer des",
"dead mount death play",
"der dieb und das biest",
"der fuchs und der kleine tanuki",
"der geschmack nach melone",
"der stärkste held mit dem mal der schwäche",
"die for me, my darling",
"die hexe und ihr drache",
"die nacht hinter dem dreiecksfenster",
"die schokohexe ",
"die walkinder",
"don't lie to me",
"drachenregen",
2024-05-01 07:59:17 +00:00
"#drcl",
"dr. stone",
"edens zero",
"ein bund fürs leben",
"ein landei aus dem dorf vor dem letzten dungeon sucht das abenteuer in der stadt",
"elden ring",
2024-05-01 07:59:17 +00:00
"elden ring kapitel",
"enceladus - die graphic novel",
"fairy tale",
"fangirl",
"final fantasy",
"fire force",
"flüster mir ein liebeslied",
"folge den wolken nach nord-nordwest",
"from bottom to lover",
"gachiakuta",
"gannibal",
"goblin slayer!",
"harahara sensei",
"hiraeth",
"human extinction",
"hunter x hunter",
"i hear the sunspot",
"i'll be here for you",
"im schatten der fabriken",
"insomniacs",
2024-05-01 07:59:17 +00:00
"in/spectre",
"isekai office worker",
2024-05-01 07:59:17 +00:00
"is love the answer?",
"jagaaan",
"jealousy blinds love",
"just mary",
"kabukicho bad trip",
"kijin gentosho",
"lass meine hand nicht los",
"liebe ist (k)ein wettkampf",
2024-05-01 07:59:17 +00:00
"lieb mich noch, bevor du stirbst",
"lightning and romance",
"lonely castle in the mirror",
"love escape",
"lullaby of the dawn",
"madk",
"manga love story",
"meet me online",
"megumi &amp; tsugumi",
"meine arbeit als missionar in einer gottlosen welt",
"meine wiedergeburt als schleim in einer anderen welt",
2024-05-01 07:59:17 +00:00
"mein isekai-leben",
"midnight scandal sex",
"minato's coin laundry",
"mord im dekagon",
"moriarty the patriot",
"mpd psycho",
"mr nobody",
"mushoku tensei",
"my dear curse-casting vampiress",
"my genderless boyfriend",
"my hero academia",
"my love will last till the end of time",
"nana &amp; kaoru: das letzte jahr",
"never love an egoist",
"nina - die sterne sind dein schicksal",
"one piece",
"overlord",
"planetes perfect",
2024-05-01 07:59:17 +00:00
"planetes perfect edition",
"pluto: urasawa x tezuka",
"prinz freya",
"radiant",
"religiöse helden",
"requiem of the rose king",
2024-05-01 07:59:17 +00:00
"re:zero",
"rosen blood",
"saint seiya",
"saraba, yoki hi",
"saturn return",
"schattenprinzessin des drachenkönigs",
"servamp, band",
"seven deadly sins",
"severed",
"silent witch",
2024-05-01 07:59:17 +00:00
"shaman king",
"skip &amp; loafer",
"sleeping dead",
"stigmata",
"sword art online",
"takopi und die sache mit dem glück",
"teach me how to kill you",
"the beast must die",
"the beginning after the end",
"the dungeon of black company",
"the elusive samurai",
"the gender of mona lisa",
"the guy she was interested in wasn't a guy at all",
"the heroic legend of arslan",
"the ichinose family's deadly sins",
"the male bride",
"the man who shattered my world",
"the most distant love",
"the saint's magic power is omnipotent",
"threesome",
"tokyo revengers",
"too close to love",
2024-05-01 07:59:17 +00:00
"to the abandoned sacred beasts",
"touching your night",
"undead unluck",
"under ninja",
"unlimited lust",
"vampire knight",
"veil",
"verliebt in mehr als dein gesicht",
"victoria's electric coffin",
"vinland saga",
"wind breaker",
"wistoria",
"yakuza angel",
"you're my cutie!",
"yuzu - die kleine tierärztin",
"zombie hide sex",
2024-05-01 07:59:17 +00:00
"mein nachbar",
"wise man",
"the reprise",
"eliana",
"küsse",
"die hohe",
"wolverine",
"Merit und der ägyptische",
"Lone Wolf &amp; Cub Master",
"Ich habe 300 Jahre lang",
"interviews mit Monster-mädchen",
"sugar apple fairy tale",
"dahlia lässt den kopf nicht hängen",
"die rachsüchtige",
"mein untergang",
"virgin road",
"shojo nach der schule",
"raeliana",
"die hexe und das biest",
"penelope",
"tokyopop",
"assassin's creed",
"verbotene allianz",
"deadlock",
"twin star",
"das magische baumhaus",
"prince never give up",
"Asterix",
"Aristia",
"Tokyo Aliens",
"Gespielte Liebe",
"Der Sommer",
"Manga! Manga!",
"Yuzu",
"Ein Zeichen der Zuneigung",
"Wiedergeburt in Maydare",
"Solo Leveling Roman Taschenbuchausgabe",
"Die mit dem Teufel tanzt",
"relife",
"konosuba",
"one room dog",
"rental girlfriend",
"white light ceremony",
"my senpai is annoying",
"Definitely Love",
"Real Account",
"Kreative Kurzaufgaben",
"Galerie einer neuen Galaxis",
"Peter Grill",
"Red Apple",
"A Couple of Cuckoos",
"Touring after the apocalypse",
"Murciélago",
"Star Wars",
"barakamon",
"adou",
"Ich täuschte Amnesie vor, um meinen Verlobten loszuwerden",
"Hallo, ich bin eine Hexe und mein Schwarm wünscht sich einen Liebestrank von mir",
"Colette beschließt zu sterben",
"Cheering up in the underworld",
"your sweet scent",
"all you want, whenever you want",
"my younger senpai",
"10 erste male",
"smoking behind the supermarket",
"Kleiner Tai &amp; Omi Sue",
"gestatten, ich bin's",
"skip beat",
"yona",
"Elainas Reise",
"suzume",
]);
export { trie };