How Layout Analysis Works
Esta página aún no está disponible en tu idioma.
On Opal, two routes type “key” with different finger movements. A layout analyzer finds the legal routes, uses a cost model to compare them, and counts the cheapest ones. Keymaxx shares work where the answer stays the same.
Text to Keystrokes
Section titled “Text to Keystrokes”On Zak Venter’s Opal, the Magic key types “e” after
Types key
Types key
For a typist, Opal’s rule gives the Magic key’s behavior after that first press. For an analyzer, it reveals a second way to write “e” there. Both routes enter the search, and the different finger movements give the cost model something to compare.
The rules that map keystrokes to text form a finite-state transducer. Each press reads the layout’s current state, such as active layers, pending text, and recent presses. It updates that state and can output part of a character or several at once. Holding Shift can change the layer without writing anything. Analysis uses the rules in reverse, starting from the desired text and finding the legal routes that produce it.
Corpus Text and Reuse
Section titled “Corpus Text and Reuse”Corpus preparation is shared across layouts. If “key” occurs as two independent sequences, Keymaxx prepares that sequence once with an occurrence count of two. Each layout still has its own job: solve that text once from the initial typing state and count the result twice. “A key” is a different sequence; the space is inside it, and the layout can still remember the earlier press.
How the corpus is supplied determines what is independent. Raw text breaks at characters excluded by the selected rules: if the semicolon is excluded, “a key; read the label” gives two runs. A counted entry keeps its supplied boundary, and the same excluded character makes the entry invalid. A word separator, or word boundaries supplied with the text, divides the words within a sequence without resetting the layout.
The processed corpus keeps words and sequences separately. The word “key” has one spelling entry even when it occurs both alone and in “a key”. The two sequences retain different word lists and occurrence counts. Each list starts at the beginning of its sequence. The word-entry record for “key” can therefore distinguish a sequence start from an occurrence after “a”. That distinction will matter when the decoder learns which contexts it needs to solve.
Written Characters and Key Output
Section titled “Written Characters and Key Output”Gujarati InScript can type “પ્ર” with three separate outputs or with a shortcut for the last two code points.
The players count the completed target characters after each event: 0 → 0 → 1 on the letter route and 0 → 0 → 1 → 1 on the shortcut. When the first player shows “પ્”, it is still waiting for Ra to finish “પ્ર”. The same “પ્” could be a complete character in a different target.
A character here is one Unicode extended grapheme cluster. The virama extends Pa, and the conjunct rule keeps Ra in the same cluster. The dotted circle in the diagram makes the isolated virama readable and is only a display aid.
Keymaxx puts the corpus in Normalization Form C before applying its alphabet and counting characters. Each layout can reuse those written positions. The matcher can also track positions inside a character, and the typing path preserves each original key output. This is why the counter can stay put while a key adds another code point.
The Corpus Spelling Graph
Section titled “The Corpus Spelling Graph”Take a corpus with “find the key”, “watch the monkey”, and “the key works”. The three sequences name six distinct words. The spelling graph gives each word an entry and stores the paths from those entries to the empty suffix. Starting at “monkey” and reading “m”, “o”, and “n” leaves exactly the same stored tail as starting at “key”.
Keymaxx builds each spelling from the end. The pair of a character and the next suffix identifies one edge, so the paths for “key” and “monkey” share the same “k”, “e”, and “y” edges. Arrows labeled with several letters in the drawing stand for a run of single-character edges. All the words have entry points in this deterministic acyclic graph. A corpus with characters made of several code points stores this graph with its words. Simpler corpora can keep flat spelling rows and build the graph once on demand.
WordChains
Section titled “WordChains”The end of a spelling tells the matcher where a word stops. The corpus also needs to tell it where the sequence goes next. In these three sequences, “the” occurs three times and starts a sequence once. Two occurrences lead to “key”. One of those ends there and one continues to “works”.
WordChains indexes that second view. Each node counts a bounded run of words, including how often the run starts or ends a sequence. At “the” → “key”, one original position points to the end of “find the key”. The “works” branch leads to a different position in “the key works”. Those source positions, kept at sequence ends or at the edge of the retained context, let counts recover where a run occurred. The spelling graph tells a layout which characters remain; WordChains tells it which continuations appear together.
Written Text and Input Forms
Section titled “Written Text and Input Forms”An annotated corpus can provide more than one sequence for typing the same written text. The corpus format example has one row for “猫の耳” with an occurrence count of two. JIS Kana takes the kana form, “ねこのみみ”. TypeHacK takes the rōmaji form, “nekonomimi”. Each binding solves its selected input, while both keep the same original written row.
The row can also connect spans: written “猫” matches “ねこ” in one form and “neko” in the other. A comparison can align the strokes to that written span. The supplied input forms already specify the reading and written text.
The prepared corpus now supplies the text to type. The next step is to find out whether the layout can produce it, even when its presses divide the text differently.