@@ -33,9 +33,10 @@ export class SigilQuery {
3333 this.symbols.forEach((symbol, i) => {
3434 if (i % 2 === 0) {
3535 symbol.symbolType = 'prefix';
36+ // symbol.components = ['gci', 'lhf'];
3637 } else {
3738 symbol.symbolType = 'suffix';
38− // symbol.components = ['gsq', 'ablf2']
39+ // symbol.components = ['gsq', 'atrf4'];
3940 }
4041 });
4142 this.symbols = this.symbols;
@@ -50,13 +51,17 @@ export class SigilQuery {
5051 }
5152
5253 get isPlausible() {
53− return this.activeSymbols.every(symbol => !symbol.isPlausible);
54+ return this.activeSymbols.every(symbol => symbol.isPlausible);
5455 }
5556
5657 get querySyls(): string[][] {
5758 return this.activeSymbols.map(symbol => symbol.plausibleSyllables);
5859 }
5960
61+ get queryInts(): number[][] {
62+ return this.activeSymbols.map(symbol => symbol.plausibleInts);
63+ }
64+
6065 get isDefinitive() {
6166 return this.querySyls.every(syls => syls.length === 1);
6267 }
@@ -65,8 +70,14 @@ export class SigilQuery {
6570 return this.activeSymbols.some(symbol => symbol.components.length > 0);
6671 }
6772
73+ get isWorthSearching() {
74+ if (!this.isNotEmpty) return false; // 🙃
75+ if (!this.isPlausible) return false;
76+ return 100000 > this.querySyls.reduce((acc, syls) => acc * (syls.length || 256), 1);
77+ }
78+
6879 get string(): string {
69− return this.symbols.map((symbol) => symbol.components.join(',')).join('|')
80+ return this.queryInts.map((int) => int.length == 256 ? 'any' : int.join('.')).join('_');
7081 }
7182
7283 setSymbol(symbol: SymbolQuery, activeSymbolIndex: number) {
@@ -92,15 +103,18 @@ function addEquivalentParts(parts: string[]): string[] {
92103 return [...parts, ...moreParts];
93104}
94105
95−export function getPlausibleSyllables(parts: string[], symbolType: SymbolType): string[] {
96− let plausibleSyllables: string[];
106+function getSyllablesBySymbolType(symbolType: SymbolType): string[] {
97107 if (symbolType === 'prefix') {
98− plausibleSyllables = prefixes;
108+ return prefixes;
99109 } else if (symbolType === 'suffix') {
100− plausibleSyllables = suffixes;
110+ return suffixes;
101111 } else {
102− plausibleSyllables = [...prefixes, ...suffixes];
112+ return [...prefixes, ...suffixes];
103113 }
114+}
115+
116+export function getPlausibleSyllables(parts: string[], symbolType: SymbolType): string[] {
117+ let plausibleSyllables = getSyllablesBySymbolType(symbolType);
104118 const possibilitiesByPart = parts.map((partId) => {
105119 let parents = partParents[partId];
106120 const otherPart = equivalentParts[partId];
@@ -113,6 +127,11 @@ export function getPlausibleSyllables(parts: string[], symbolType: SymbolType):
113127 return plausibleSyllables;
114128}
115129
130+function convertSyllableToInt(syl: string, symbolType: SymbolType): number {
131+ let syls = getSyllablesBySymbolType(symbolType);
132+ return syls.findIndex(s => s === syl) % 256;
133+}
134+
116135export function getPlausibleNewParts(parts: string[], symbolType: SymbolType): string[] {
117136 const syllables: string[] = getPlausibleSyllables(parts, symbolType);
118137 let plausibleParts = uniq(syllables.map((syllable) => symbolDefs[syllable]).flat());
@@ -205,6 +224,10 @@ export class SymbolQuery {
205224 return getPlausibleSyllables(this.components, this.symbolType);
206225 }
207226
227+ get plausibleInts() {
228+ return this.plausibleSyllables.map(syl => convertSyllableToInt(syl, this.symbolType));
229+ }
230+
208231 get isPlausible() {
209232 return this.plausibleSyllables.length > 0;
210233 }