From ab44421b632f0875172c0019f1e7403933ec56f0 Mon Sep 17 00:00:00 2001 From: eyuelberga Date: Sun, 27 Jun 2021 18:27:14 +0300 Subject: [PATCH] refactor: rename packages --- README.md | 2 +- docs/README.md | 4 +- docs/_coverpage.md | 2 +- docs/_sidebar.md | 5 +- docs/advanced_usage.md | 2 +- docs/assets/style.css | 29 - docs/basic_usage.md | 61 +- docs/{keyboard_layout.md => input_method.md} | 69 +- docs/input_method_generator.md | 1 + docs/layout_generator.md | 1 - docs/pre_made_input_methods.md | 1 + docs/pre_made_layouts.md | 1 - docs/quick_start.md | 18 +- jest.config.js | 6 +- packages/core/src/Keywrite.ts | 40 +- packages/core/src/index.ts | 1 + packages/core/tests/Keywrite.spec.ts | 76 +- packages/ethiopic-layouts/CHANGELOG.md | 8 - .../ethiopic-layouts/src/generate-from-csv.ts | 52 - packages/ethiopic-layouts/src/index.ts | 35 - .../README.md | 2 +- .../jest.config.js | 0 .../package.json | 6 +- .../src/ET.ts | 11 +- .../src/am-ET.ts | 11 +- .../src/awn-ET_byn-ER_xan-ET.ts | 11 +- .../src/bcq-ET.ts | 11 +- .../src/csv/ET.csv | 0 .../src/csv/am-ET.csv | 0 .../src/csv/awn-ET_byn-ER_xan-ET.csv | 0 .../src/csv/bcq-ET.csv | 0 .../src/csv/gez-ET_gez-ER.csv | 0 .../src/csv/har-ET.csv | 0 .../src/csv/mym-ET_muz-ET_suq-ET_mdx-ET.csv | 0 .../src/csv/punctuation.csv | 0 .../src/csv/sgw-ET.csv | 0 .../src/csv/ti-ER.csv | 0 .../src/csv/ti-ET.csv | 0 .../src/csv/xst-ET.csv | 0 .../src/generate-from-csv.ts | 54 + .../src/gez-ET_gez-ER.ts | 11 +- .../src/har-ET.ts | 11 +- packages/ethiopic_input_methods/src/index.ts | 46 + .../src/input-methods.ts} | 18 +- .../ethiopic_input_methods/src/interfaces.ts | 3 + .../src/mym-ET_muz-ET_suq-ET_mdx-ET.ts | 11 +- .../src/sgw-ET.ts | 11 +- .../src/ti-ER.ts | 11 +- .../src/ti-ET.ts | 11 +- .../src/xst-ET.ts | 11 +- .../tsconfig.json | 2 +- packages/input-method-generator/CHANGELOG.md | 7 + packages/input-method-generator/README.md | 1 + .../jest.config.js | 0 .../package.json | 4 +- .../src/core.ts | 12 +- .../src/index.ts | 0 .../src/interfaces.ts | 0 .../src/utils.ts | 0 .../tests/core.spec.ts | 0 .../tests/utils.spec.ts | 0 .../tsconfig.json | 0 packages/layout-generator/CHANGELOG.md | 8 - packages/layout-generator/README.md | 1 - packages/web/README.md | 2 +- packages/web/src/ET.ts | 1258 ----------------- packages/web/src/KeywriteWeb.ts | 13 +- packages/web/src/index.ts | 1 + packages/web/tests/KeywriteWeb.spec.ts | 34 +- .../web/tests/{layout.ts => input-method.ts} | 0 tsconfig.json | 8 +- 71 files changed, 372 insertions(+), 1643 deletions(-) rename docs/{keyboard_layout.md => input_method.md} (65%) create mode 100644 docs/input_method_generator.md delete mode 100644 docs/layout_generator.md create mode 100644 docs/pre_made_input_methods.md delete mode 100644 docs/pre_made_layouts.md delete mode 100644 packages/ethiopic-layouts/CHANGELOG.md delete mode 100644 packages/ethiopic-layouts/src/generate-from-csv.ts delete mode 100644 packages/ethiopic-layouts/src/index.ts rename packages/{ethiopic-layouts => ethiopic_input_methods}/README.md (79%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/jest.config.js (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/package.json (81%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/am-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/awn-ET_byn-ER_xan-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/bcq-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/am-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/awn-ET_byn-ER_xan-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/bcq-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/gez-ET_gez-ER.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/har-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/mym-ET_muz-ET_suq-ET_mdx-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/punctuation.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/sgw-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/ti-ER.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/ti-ET.csv (100%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/csv/xst-ET.csv (100%) create mode 100644 packages/ethiopic_input_methods/src/generate-from-csv.ts rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/gez-ET_gez-ER.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/har-ET.ts (99%) create mode 100644 packages/ethiopic_input_methods/src/index.ts rename packages/{ethiopic-layouts/src/layouts.ts => ethiopic_input_methods/src/input-methods.ts} (61%) create mode 100644 packages/ethiopic_input_methods/src/interfaces.ts rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/sgw-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/ti-ER.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/ti-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/src/xst-ET.ts (99%) rename packages/{ethiopic-layouts => ethiopic_input_methods}/tsconfig.json (87%) create mode 100644 packages/input-method-generator/CHANGELOG.md create mode 100644 packages/input-method-generator/README.md rename packages/{layout-generator => input-method-generator}/jest.config.js (100%) rename packages/{layout-generator => input-method-generator}/package.json (85%) rename packages/{layout-generator => input-method-generator}/src/core.ts (76%) rename packages/{layout-generator => input-method-generator}/src/index.ts (100%) rename packages/{layout-generator => input-method-generator}/src/interfaces.ts (100%) rename packages/{layout-generator => input-method-generator}/src/utils.ts (100%) rename packages/{layout-generator => input-method-generator}/tests/core.spec.ts (100%) rename packages/{layout-generator => input-method-generator}/tests/utils.spec.ts (100%) rename packages/{layout-generator => input-method-generator}/tsconfig.json (100%) delete mode 100644 packages/layout-generator/CHANGELOG.md delete mode 100644 packages/layout-generator/README.md delete mode 100644 packages/web/src/ET.ts rename packages/web/tests/{layout.ts => input-method.ts} (100%) diff --git a/README.md b/README.md index 0d2ef3a..1a99554 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Keywrite is a Javascript library that allows you to type non-latin scripts in an ## Features 🚀 - **Ease of Use:** Keywrite can be integrated to most modern web frameworks with ease. -- **Flexible Keyboard Layouts:** You can configure Keywrite with different keyboard layouts and also change layouts at runtime. +- **Flexible Input Methods:** You can configure Keywrite with different input methods and also change layouts at runtime. - **Custom Layouts:** You can create your own layouts and add them to Keywrite - **Fully Extendable:** You can extend the Keywrite core API easily to support different use-cases. - **Typescript Support:** The codebase is completely written in typescript diff --git a/docs/README.md b/docs/README.md index 3ecf06a..5710024 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ > _type non-latin scripts on the web_ -**Keywrite** is a JavaScript library that allows you to type non-latin scripts in any web based application using a standard keyboard. You can add it to your text input controls and start typing with your configured keyboard layout. +**Keywrite** is a JavaScript library that allows you to type non-latin scripts in any web based application using a standard keyboard. You can add it to your text input controls and start typing with your configured input-method. The aim of this project is to enable web developers to add support for typing non-latin based texts on web and hybrid applications, so users can type different languages without configuring their operating system or installing additional software. @@ -16,7 +16,7 @@ The aim of this project is to enable web developers to add support for typing no **What does Keywrite do?** -1. It allows you to map keyboard inputs to symbols, which you define in a keyboard layout configuration file. +1. It allows you to map keyboard inputs to symbols, which you define in a input-method configuration file. 1. It binds with web input controls to add multi-lingual typing to your web application **Things you can build with Keywrite** diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 7343c61..f214bda 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -2,7 +2,7 @@ > type non-latin scripts on the web -**Keywrite** is a Javascript library that allows you to type non-latin scripts in any web based application using a standard keyboard. You can add it to your text input controls and start typing in the your configured keyboard layout. +**Keywrite** is a Javascript library that allows you to type non-latin scripts in any web based application using a standard keyboard. You can add it to your text input controls and start typing with your configured input-method. [GitHub](https://github.com/eyuelberga/keywrite) [Get Started](README.md) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 37776fc..ab6c319 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -7,7 +7,8 @@ - [Basic Usage](basic_usage.md) - [Advanced Usage](advanced_usage.md) - Reference - - [Keyboard Layout](keyboard_layout.md) - [Examples](examples.md) - - [Pre-made Layouts](pre_made_layouts.md) + - [Input Method](input_method.md) + - [Pre-made Input methods](pre_made_input-methods.md) + - [Input Method Generator](input_method_generator.md) - [Packages](packages.md) diff --git a/docs/advanced_usage.md b/docs/advanced_usage.md index 4bbd40d..cef6c54 100644 --- a/docs/advanced_usage.md +++ b/docs/advanced_usage.md @@ -5,5 +5,5 @@ By extending the exported class from `@keywrite/core` you can add app-specific logic. The most important method in the core class would be the `write` method. This method takes in a character and resolves it into a special -symbol as per the layout specification and returns the symbol and replacement +symbol as per the input-method specification and returns the symbol and replacement state (if previous character needs to be replaced with the new symbol). diff --git a/docs/assets/style.css b/docs/assets/style.css index 5d29a7f..79398e0 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -30,35 +30,6 @@ a { transition: all 0.3s linear; } -div.search { - border-bottom: 2px solid #787881; - border: none; - background-color: var(--theme-color-secondary-light); - padding: 0; -} - -.search .results-panel.show { - background-color: #05827e; - background-color: #fff; - color: #000; -} - -.search a { - padding: 1rem; - display: block; - transition: background-color 0.3s ease; -} - -.search a:hover { - color: var(--theme-color-dark); -} - -.search p.empty { - margin: 0; - padding: 1rem; - background-color: #f1f1f2; -} - .sidebar > h1 { font-size: 2rem; } diff --git a/docs/basic_usage.md b/docs/basic_usage.md index caa462a..18c92d0 100644 --- a/docs/basic_usage.md +++ b/docs/basic_usage.md @@ -4,24 +4,25 @@ Creating a new instance of Keywrite requires two parameters. -1. **input control:** this is the HTML element you want to bind with the instance -1. **keyboard layouts:** which is a key value pair of layout names and definitions +1. **input element:** this is the HTML element you want to bind with the instance +1. **input-methods:** which is a key value pair of input-method names and definitions -### Binding with input controls +### Binding with input elements Currently, Keywrite supports binding on `HTMLInputElement` and `HTMLTextAreaElement`. During initialization you must provide a reference to the element you wish to bind with the Keywrite instance. You can use `document.querySelector` or a similar method. -### Defining keyboard layouts +### Defining Input methods -You also need to provide a Keywrite instance with keyboard layouts. Read more about -keyboard layouts [here](keyboard_layout.md). The `layout` parameter takes an object -with the layout name being the key and the actual layout as the value. +You also need to provide a Keywrite instance with Input methods. Read more about +input-methods [here](input_method.md). The `input-methods` parameter takes an object +with the input-method name being the key and the actual input-method definition +as the value. ```javascript // add to HTMLInputElement without enabling it -new KeywriteWeb(document.querySelector('input'), { myLayout }); +new KeywriteWeb(document.querySelector('input'), { myInputMethod }); ``` ## Enable/Disable Keywrite instance @@ -31,49 +32,51 @@ setting the `on` parameter during initialization. ```javascript // add to HTMLInputElement without enabling it -new KeywriteWeb(document.querySelector('input'), { myLayout }, false); +new KeywriteWeb(document.querySelector('input'), { myInputMethod }, false); ``` -It is also possible to toggle between on and off states during run time by changing the -values of the `on` property on the `KeywriteWeb` instance. +It is also possible to toggle between on and off states during run time by +changing the values of the `on` property on the `KeywriteWeb` instance. ```javascript // add to HTMLInputElement without enabling it -const myKeywriteInstance = new KeywriteWeb(document.querySelector('input'), { myLayout }, false); +const myKeywriteInstance = new KeywriteWeb(document.querySelector('input'), { myInputMethod }, false); // change the on property to enable it myKeywriteInstance.on = true; ``` -## Adding multiple keyboard layouts +## Adding multiple input-methods -It is possible to add more than one keyboard layout to an instance. This could +It is possible to add more than one input-method to an instance. This could be useful if you want users to pick from a selection of -input methods. Multiple layout definitions can be added during initialization. +input-methods. Multiple input-method definitions can be added during initialization. ```javascript -// keyboard layout definitions -import layout1 from './layout1'; -import layout2 from './layout2'; -import layout3 from './layout3'; +// input-method definitions +import inputMethod1 from './inputmethod1'; +import inputMethod2 from './inputmethod2'; +import inputMethod3 from './inputmethod3'; -// add to HTMLInputElement with multiple layout definitions -// the parameter accepts a map of layout name and its definition +// add to HTMLInputElement with multiple input-method definitions +// the parameter accepts a map of input-method name and its definition const myKeywriteInstance = new KeywriteWeb(document.querySelector('input'), { - default: layout1, - typewriter: layout2, - mnemonic: layout3, + default: inputMethod1, + typewriter: inputMethod2, + mnemonic: inputMethod3, }); ``` -You can switch between the layouts by setting the `current` value in the instance to -the key name of the layout you want. +You can switch between input-methods by setting the `current` value in the instance to +the key of the input-method you want. ```javascript myKeywriteInstance.current = 'typewriter'; ``` -## Using pre-made keyboard layouts +## Using pre-made input-methods -You can install pre-made layouts to use in your project. A list of all available -layouts can be found [here](pre_made_layouts.md) +You can install pre-made input-methods to use in your project. A list of all +available input-methods can be found [here](pre_made_input-methods.md). + +To create your own input-method, refer to [this guide](input_method_generator.md) diff --git a/docs/keyboard_layout.md b/docs/input_method.md similarity index 65% rename from docs/keyboard_layout.md rename to docs/input_method.md index c50b6b0..f4a662b 100644 --- a/docs/keyboard_layout.md +++ b/docs/input_method.md @@ -1,13 +1,14 @@ -# Keyboard Layout +# Input Method -A keyboard layout maps keyboard inputs to symbols. It allows us to define key combinations that -produce a certain symbol. It is generally a JavaScript object with an -input character, an output value or a next value. +An input-method translates keyboard inputs to symbols. It allows us to define +key combinations that produce a certain character. +In our case, it is a JavaScript object with an input character, +an output value and a next value. -A simple keyboard layouts looks something like this: +A simple input-methods looks something like this: ```javascript -const myLayout = { +const myInputMethod = { a: { value: '∀', next: null }, e: { value: '∈', @@ -21,32 +22,32 @@ const myLayout = { }; ``` -In the above layout, the `a` keyboard input is mapped to the `∀` symbol. +In the above input-method, the `a` key stroke is translated to the `∀` symbol. Pressing `e` will output `∈`, pressing `e` again will output `∉`. -## Components of a keyboard layout +## Components of an Input-method -A keyboard layout has two basic components: +An Input-method has two basic components: 1. **SymbolMap:** object with a `value` and `next` keys. -1. **KeyboardLayout:** object mapping an input key to a symbol map object +1. **InputMethod:** object mapping a key stroke to a symbol map object -Keyboard layout is a nested structure of these two components. Lets see this -components in more detail. +A Keyboard Input-method is a nested structure of these two components. +Lets see the components in more detail. -The interface for `SymbolMap` and `KeyboardLayout` is shown below: +The interface for `SymbolMap` and `InputMethod` is shown below: ```typescript interface SymbolMap { value: string | null; - next: KeyboardLayout | null; + next: InputMethod | null; } -type KeyboardLayout = Record; +type InputMethod = Record; ``` -`value` represents the output symbol and `next` represents the next keyboard -layout definition. +`value` represents the output symbol and `next` represents the next +input-method definition. From our previous example, the symbol map for the `a` key is this: @@ -54,18 +55,18 @@ From our previous example, the symbol map for the `a` key is this: const symbolMapA = { value: '∀', next: null }; ``` -The keyboard layout is as follows: +The input-method is as follows: ```javascript -const layoutA = { a: { value: '∀', next: null } }; +const inputMethodA = { a: { value: '∀', next: null } }; ``` -`layoutA` is a valid layout that you can provide to a Keywrite instance. -But to build a more complete keyboard layout, you can add additional input key +`inputMethodA` is a valid input-method that you can provide to a Keywrite instance. +But to build a more complete input-method, you can add additional input key and symbol map pairs. ```javascript -const layoutWithMoreInputKeys = { +const inputMethodWithMoreInputKeys = { a: { value: '∀', next: null }, b: { value: '⋈', next: null }, c: { value: '⊂', next: null }, @@ -73,7 +74,7 @@ const layoutWithMoreInputKeys = { }; ``` -Our inputs and outputs for the above layout are as follows: +Our inputs and outputs for the above input-method are as follows: | Input Key | Output Symbol | | --------- | ------------- | @@ -82,11 +83,11 @@ Our inputs and outputs for the above layout are as follows: | `c` | ⊂ | | `d` | ∂ | -We would also need to map certain combination of key inputs to a single character. -We can do that by nesting additional layouts in the symbol map `next` field. +We would also need to map certain combination of key strokes to a single character. +We can do that by nesting additional input-methods in the symbol map `next` field. ```javascript -const myLayout = { +const myInputMethod = { a: { value: '∀', next: null, @@ -177,18 +178,20 @@ Now our input output table looks like this: The complete code is shown below: - -## Creating keyboard layouts +## Creating Input-methods -Keyboard layout definitions are simple json objects. It is possible to manually write a layout definition that will work with Keywrite, but a better way would be to use the [Layout Generator](layout_generator.md). +Keyboard Input-method definitions are simple JavaScript objects. It is possible +to manually write a input-method definition that will work with Keywrite, +but a better way would be to use the [Input method Generator](input-method_generator.md). -## Pre-made layouts +## Pre-made Input-methods -Some layouts are avaliable pre-made and you add simply add them to your project. -A list of all available layouts can be found [here](pre_made_layouts.md) +Some input-methods are available pre-made and you add simply add them to your project. +A list of all available input-methods can be found [here](pre_made_input-methods.md) diff --git a/docs/input_method_generator.md b/docs/input_method_generator.md new file mode 100644 index 0000000..b03afc3 --- /dev/null +++ b/docs/input_method_generator.md @@ -0,0 +1 @@ +# Input Method Generator diff --git a/docs/layout_generator.md b/docs/layout_generator.md deleted file mode 100644 index df635b4..0000000 --- a/docs/layout_generator.md +++ /dev/null @@ -1 +0,0 @@ -# Examples diff --git a/docs/pre_made_input_methods.md b/docs/pre_made_input_methods.md new file mode 100644 index 0000000..6cdffa0 --- /dev/null +++ b/docs/pre_made_input_methods.md @@ -0,0 +1 @@ +# Pre-made Input methods diff --git a/docs/pre_made_layouts.md b/docs/pre_made_layouts.md deleted file mode 100644 index 95a2f98..0000000 --- a/docs/pre_made_layouts.md +++ /dev/null @@ -1 +0,0 @@ -# Pre-made Layouts diff --git a/docs/quick_start.md b/docs/quick_start.md index 295bed2..625c0e0 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -22,12 +22,14 @@ Once you have installed the `@keywrite/web` you can import it to your project: import { KeywriteWeb } from '@keywrite/web'; ``` -You also need a keyboard layout to start using Keywrite. [Keyboard layouts](keyboard_layout.md) -map keyboard inputs to symbols, this will allow you to define which key combinations that -produce a certain symbol. Lets define a simple keyboard layout to get started: +You also need a Input-method to start using Keywrite. [Keyboard Input-methods](input_method.md) +map keyboard inputs to symbols, this will allow us to define key stroke +combinations that produce a certain symbol. + +Lets define a simple input-method to get started: ```javascript -const myLayout = { +const myInputMethod = { a: { value: '∀', next: null }, e: { value: '∈', @@ -41,16 +43,16 @@ const myLayout = { }; ``` -Refer to [this guide](keyboard_layout.md) to learn more about keyboard layouts. +Refer to [this guide](input_method.md) to learn more about Input-methods. Next, we initialize our `KeywriteWeb` instance using a reference to either a -`textarea` or `input` element and the layout. +`textarea` or `input` element and the Input-method. ```javascript // add to HTMLInputElement -new KeywriteWeb(document.querySelector('input'), { myLayout }); +new KeywriteWeb(document.querySelector('input'), { myInputMethod }); // add to HTMLTextAreaElement -new KeywriteWeb(document.querySelector('textarea'), { myLayout }); +new KeywriteWeb(document.querySelector('textarea'), { myInputMethod }); ``` The complete code is shown below: diff --git a/jest.config.js b/jest.config.js index f6d8a49..69a9437 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,10 +6,10 @@ module.exports = { collectCoverageFrom: ['src/**/*.ts'], coverageThreshold: { global: { - branches: 90, + branches: 100, functions: 100, - lines: 95, - statements: 95, + lines: 100, + statements: 100, }, }, transform: { '.(ts|tsx)$': 'ts-jest/dist' }, diff --git a/packages/core/src/Keywrite.ts b/packages/core/src/Keywrite.ts index 555712e..55fb875 100644 --- a/packages/core/src/Keywrite.ts +++ b/packages/core/src/Keywrite.ts @@ -1,14 +1,14 @@ -export type KeyboardLayout = Record; +export type InputMethod = Record; export interface SymbolMap { value: string | null; - next: KeyboardLayout | null; + next: InputMethod | null; } -export class Keywrite { +export default class Keywrite { private level: number; - private scope: KeyboardLayout; - private keyboardLayouts: Record; - private currentLayout: string; + private scope: InputMethod; + private keyboardInputMethods: Record; + private currentInputMethod: string; protected keyBlacklist: string[] = [ 'Shift', 'CapsLock', @@ -32,31 +32,31 @@ export class Keywrite { 'Tab', ]; - constructor(layouts: Record) { + constructor(inputMethods: Record) { this.level = 0; this.scope = {}; - this.keyboardLayouts = layouts; - this.currentLayout = Object.keys(this.keyboardLayouts)[0]; + this.keyboardInputMethods = inputMethods; + this.currentInputMethod = Object.keys(this.keyboardInputMethods)[0]; } get current(): string { - return this.currentLayout; + return this.currentInputMethod; } - set current(layout: string) { - if (layout in this.keyboardLayouts) { - this.currentLayout = layout; + set current(inputMethod: string) { + if (inputMethod in this.keyboardInputMethods) { + this.currentInputMethod = inputMethod; this.resetScope(); } else { - throw new Error('Layout does not exists'); + throw new Error('Input Method does not exists'); } } - get layouts(): string[] { - return Object.keys(this.keyboardLayouts); + get inputMethods(): string[] { + return Object.keys(this.keyboardInputMethods); } - setLayouts(layouts: Record): void { - this.keyboardLayouts = layouts; - this.currentLayout = Object.keys(this.keyboardLayouts)[0]; + setInputMethods(inputMethods: Record): void { + this.keyboardInputMethods = inputMethods; + this.currentInputMethod = Object.keys(this.keyboardInputMethods)[0]; this.resetScope(); } public write(char: string): { symbol: string; replace: boolean } { @@ -77,7 +77,7 @@ export class Keywrite { return replace; } protected resetScope(): void { - this.scope = this.keyboardLayouts[this.currentLayout]; + this.scope = this.keyboardInputMethods[this.currentInputMethod]; this.level = 0; } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index c962179..43d9c94 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1 +1,2 @@ export * from './Keywrite'; +export { default } from './Keywrite'; diff --git a/packages/core/tests/Keywrite.spec.ts b/packages/core/tests/Keywrite.spec.ts index 34429b2..84ec500 100644 --- a/packages/core/tests/Keywrite.spec.ts +++ b/packages/core/tests/Keywrite.spec.ts @@ -1,8 +1,8 @@ -import { Keywrite } from '../src'; +import Keywrite from '../src'; describe('Keywrite.ts', () => { let instance: any = null; - const layouts = { - layout1: { + const inputMethods = { + inputMethod1: { a: { value: 'አ', next: null }, i: { value: 'ኢ', @@ -59,62 +59,62 @@ describe('Keywrite.ts', () => { }, }, }, - layout2: { b: { value: 'b', next: null }, a: { value: 'ኢ', next: null } }, + inputMethod2: { b: { value: 'b', next: null }, a: { value: 'ኢ', next: null } }, }; beforeEach(() => { - instance = new Keywrite(layouts); + instance = new Keywrite(inputMethods); }); - it('should set current keyboard-layout to first on map by default', () => { - expect(instance.current).toBe('layout1'); + it('should set current keyboard-input-method to first on map by default', () => { + expect(instance.current).toBe('inputMethod1'); }); - it('should set current keyboard-layout using name', () => { - const newLayout = 'layout2'; - instance.current = newLayout; - expect(instance.current).toBe(newLayout); + it('should set current keyboard-input-method using name', () => { + const newInputMethod = 'inputMethod2'; + instance.current = newInputMethod; + expect(instance.current).toBe(newInputMethod); }); - it("should throw error if input for current keyboard-layout doesn't exist on map", () => { - const unknownLayout = 'layout-unknown'; + it("should throw error if the value set for `current` doesn't exist on keyboard-input-method map", () => { + const unknownInputMethod = 'inputMethod-unknown'; expect(() => { - instance.current = unknownLayout; + instance.current = unknownInputMethod; }).toThrow(); }); - it('should get all avaliable keyboard-layout names ', () => { - expect(instance.layouts).toContain('layout1'); - expect(instance.layouts).toContain('layout2'); + it('should get all avaliable keyboard-input-method names ', () => { + expect(instance.inputMethods).toContain('inputMethod1'); + expect(instance.inputMethods).toContain('inputMethod2'); }); - it('should set new keyboard-layout map ', () => { - const newLayouts = { - layout3: { a: { value: 'a', next: null } }, - layout4: { b: { value: 'b', next: null } }, + it('should set new keyboard-input-method map ', () => { + const newInputMethods = { + inputMethod3: { a: { value: 'a', next: null } }, + inputMethod4: { b: { value: 'b', next: null } }, }; - instance.setLayouts(newLayouts); - expect(instance.layouts).toContain('layout3'); - expect(instance.layouts).toContain('layout4'); + instance.setInputMethods(newInputMethods); + expect(instance.inputMethods).toContain('inputMethod3'); + expect(instance.inputMethods).toContain('inputMethod4'); }); - it('should update current layout when new keyboard-layout map is set ', () => { - const newLayouts = { - layout3: { a: { value: 'a', next: null } }, - layout4: { b: { value: 'b', next: null } }, + it('should update current input method when new keyboard-input-method map is set ', () => { + const newInputMethods = { + inputMethod3: { a: { value: 'a', next: null } }, + inputMethod4: { b: { value: 'b', next: null } }, }; - instance.setLayouts(newLayouts); - expect(instance.current).toBe('layout3'); + instance.setInputMethods(newInputMethods); + expect(instance.current).toBe('inputMethod3'); }); - it('should be able to use new layout after change', () => { + it('should be able to use new input method after changing', () => { expect(instance.write('a')).toEqual({ symbol: 'አ', replace: false }); - const newLayout = 'layout2'; - instance.current = newLayout; + const newInputMethod = 'inputMethod2'; + instance.current = newInputMethod; expect(instance.write('a')).toEqual({ symbol: 'ኢ', replace: false }); }); - it('should be able to use new layout after new keyboard-layout map is set ', () => { + it('should be able to use new input method after new keyboard-input-methods map is set ', () => { expect(instance.write('a')).toEqual({ symbol: 'አ', replace: false }); - const newLayouts = { - layout3: { a: { value: '@', next: null } }, - layout4: { b: { value: '&', next: null } }, + const newInputMethods = { + inputMethod3: { a: { value: '@', next: null } }, + inputMethod4: { b: { value: '&', next: null } }, }; - instance.setLayouts(newLayouts); + instance.setInputMethods(newInputMethods); expect(instance.write('a')).toEqual({ symbol: '@', replace: false }); }); diff --git a/packages/ethiopic-layouts/CHANGELOG.md b/packages/ethiopic-layouts/CHANGELOG.md deleted file mode 100644 index f7f8925..0000000 --- a/packages/ethiopic-layouts/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# @keywrite/ethiopic-layouts - -## 0.1.1 -### Patch Changes - - - -- [`bc3cc2a`](https://github.com/eyuelberga/keywrite/commit/bc3cc2ac88eae4ed543c31e62a551c7d333f8990) [#1](https://github.com/eyuelberga/keywrite/pull/1) Thanks [@eyuelberga](https://github.com/eyuelberga)! - Initial release diff --git a/packages/ethiopic-layouts/src/generate-from-csv.ts b/packages/ethiopic-layouts/src/generate-from-csv.ts deleted file mode 100644 index d6c1ad3..0000000 --- a/packages/ethiopic-layouts/src/generate-from-csv.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { generateMapForRow } from '@keywrite/layout-generator'; -import csvParser from 'csv-parser'; -import fs from 'fs'; -import layouts from './layouts'; -const punctuation = {}; -fs.createReadStream(`${__dirname}/csv/punctuation.csv`) - .pipe(csvParser()) - .on('data', (row) => { - generateMapForRow(punctuation, row); - }) - .on('end', () => { - console.log('layout successfully generated for punctuation'); - }); -for (const [code, { name, path }] of Object.entries(layouts)) { - const layout = {}; - fs.createReadStream(`${__dirname}/csv/${path}.csv`) - .pipe(csvParser()) - .on('data', (row) => { - generateMapForRow(layout, row); - }) - .on('end', () => { - console.log(`layout successfully generated for ${name}`); - const meta = { - name, - regions: code.split('_'), - }; - - fs.writeFileSync( - `${__dirname}/${code}.ts`, - `import { KeyboardLayout } from '@keywrite/core'; - type LayoutMeta = {name: string; regions: string[];}; - type LayoutSpec = { meta:LayoutMeta; layout: KeyboardLayout; }; - const layout : LayoutSpec = ${JSON.stringify({ meta, layout: { ...layout, ...punctuation } })}; - export default layout; - `, - ); - }); -} -// write index indexFile -// const layoutMap:Record = {} -let index = ` -import { KeyboardLayout } from '@keywrite/core'; -const layouts:Record = {};`; -for (const { path, name } of Object.values(layouts)) { - const layout = name.replace(/[^a-zA-Z]/g, ''); - index += ` - import ${layout} from './${path}'; - layouts[${layout}.meta.name] = ${layout}.layout; - `; -} -index += `export default layouts;`; -fs.writeFileSync(`${__dirname}/index.ts`, index); diff --git a/packages/ethiopic-layouts/src/index.ts b/packages/ethiopic-layouts/src/index.ts deleted file mode 100644 index 25e315f..0000000 --- a/packages/ethiopic-layouts/src/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { KeyboardLayout } from '@keywrite/core'; -const layouts: Record = {}; -import Amharic from './am-ET'; -layouts[Amharic.meta.name] = Amharic.layout; - -import AwngiBlinXamtanga from './awn-ET_byn-ER_xan-ET'; -layouts[AwngiBlinXamtanga.meta.name] = AwngiBlinXamtanga.layout; - -import Bench from './bcq-ET'; -layouts[Bench.meta.name] = Bench.layout; - -import DiziMeenMursiSuri from './mym-ET_muz-ET_suq-ET_mdx-ET'; -layouts[DiziMeenMursiSuri.meta.name] = DiziMeenMursiSuri.layout; - -import Geez from './gez-ET_gez-ER'; -layouts[Geez.meta.name] = Geez.layout; - -import Harari from './har-ET'; -layouts[Harari.meta.name] = Harari.layout; - -import Sebatbeit from './sgw-ET'; -layouts[Sebatbeit.meta.name] = Sebatbeit.layout; - -import Silte from './xst-ET'; -layouts[Silte.meta.name] = Silte.layout; - -import TigrinyaEritrean from './ti-ER'; -layouts[TigrinyaEritrean.meta.name] = TigrinyaEritrean.layout; - -import TigrinyaEthiopia from './ti-ET'; -layouts[TigrinyaEthiopia.meta.name] = TigrinyaEthiopia.layout; - -import EthiopicLanguageNeutral from './ET'; -layouts[EthiopicLanguageNeutral.meta.name] = EthiopicLanguageNeutral.layout; -export default layouts; diff --git a/packages/ethiopic-layouts/README.md b/packages/ethiopic_input_methods/README.md similarity index 79% rename from packages/ethiopic-layouts/README.md rename to packages/ethiopic_input_methods/README.md index 80dec2d..5b7e2a1 100644 --- a/packages/ethiopic-layouts/README.md +++ b/packages/ethiopic_input_methods/README.md @@ -1,6 +1,6 @@ ## @keywrite/ethiopic-layouts -This package contains ethiopic keyboard layouts generated form the specification +This package contains ethiopic input methods generated form the specification described by [the Ge'ez Frontier Foundation specification](http://keyboards.ethiopic.org/specification/) ## Usage diff --git a/packages/ethiopic-layouts/jest.config.js b/packages/ethiopic_input_methods/jest.config.js similarity index 100% rename from packages/ethiopic-layouts/jest.config.js rename to packages/ethiopic_input_methods/jest.config.js diff --git a/packages/ethiopic-layouts/package.json b/packages/ethiopic_input_methods/package.json similarity index 81% rename from packages/ethiopic-layouts/package.json rename to packages/ethiopic_input_methods/package.json index 2e9d9b0..74cd7fc 100644 --- a/packages/ethiopic-layouts/package.json +++ b/packages/ethiopic_input_methods/package.json @@ -1,12 +1,12 @@ { - "name": "@keywrite/ethiopic-layouts", + "name": "@keywrite/ethiopic-input-methods", "version": "0.1.1", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", "repository": { "type": "git", - "directory": "packages/ethiopic-layouts", + "directory": "packages/ethiopic-input-methods", "url": "https://github.com/eyuelberga/keywrite.git" }, "scripts": { @@ -18,7 +18,7 @@ "lint": "eslint \"./src/**/*.{ts,tsx}\" --max-warnings=10" }, "devDependencies": { - "@keywrite/layout-generator": "^0.1.1", + "@keywrite/input-method-generator": "^0.1.1", "@keywrite/core": "^0.1.1", "csv-parser": "^3.0.0", "ts-node": "^9.1.1" diff --git a/packages/ethiopic-layouts/src/ET.ts b/packages/ethiopic_input_methods/src/ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/ET.ts rename to packages/ethiopic_input_methods/src/ET.ts index cf5694d..bafe770 100644 --- a/packages/ethiopic-layouts/src/ET.ts +++ b/packages/ethiopic_input_methods/src/ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Ethiopic(Language Neutral)', regions: ['ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -1255,4 +1254,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/am-ET.ts b/packages/ethiopic_input_methods/src/am-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/am-ET.ts rename to packages/ethiopic_input_methods/src/am-ET.ts index 10e96ac..023b269 100644 --- a/packages/ethiopic-layouts/src/am-ET.ts +++ b/packages/ethiopic_input_methods/src/am-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Amharic', regions: ['am-ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -904,4 +903,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/awn-ET_byn-ER_xan-ET.ts b/packages/ethiopic_input_methods/src/awn-ET_byn-ER_xan-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/awn-ET_byn-ER_xan-ET.ts rename to packages/ethiopic_input_methods/src/awn-ET_byn-ER_xan-ET.ts index bd4f46d..e9dbd34 100644 --- a/packages/ethiopic-layouts/src/awn-ET_byn-ER_xan-ET.ts +++ b/packages/ethiopic_input_methods/src/awn-ET_byn-ER_xan-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Awngi, Blin, Xamtanga', regions: ['awn-ET', 'byn-ER', 'xan-ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -826,4 +825,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/bcq-ET.ts b/packages/ethiopic_input_methods/src/bcq-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/bcq-ET.ts rename to packages/ethiopic_input_methods/src/bcq-ET.ts index 21a5e19..73a2a13 100644 --- a/packages/ethiopic-layouts/src/bcq-ET.ts +++ b/packages/ethiopic_input_methods/src/bcq-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Bench', regions: ['bcq-ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -646,4 +645,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/csv/ET.csv b/packages/ethiopic_input_methods/src/csv/ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/ET.csv rename to packages/ethiopic_input_methods/src/csv/ET.csv diff --git a/packages/ethiopic-layouts/src/csv/am-ET.csv b/packages/ethiopic_input_methods/src/csv/am-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/am-ET.csv rename to packages/ethiopic_input_methods/src/csv/am-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/awn-ET_byn-ER_xan-ET.csv b/packages/ethiopic_input_methods/src/csv/awn-ET_byn-ER_xan-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/awn-ET_byn-ER_xan-ET.csv rename to packages/ethiopic_input_methods/src/csv/awn-ET_byn-ER_xan-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/bcq-ET.csv b/packages/ethiopic_input_methods/src/csv/bcq-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/bcq-ET.csv rename to packages/ethiopic_input_methods/src/csv/bcq-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/gez-ET_gez-ER.csv b/packages/ethiopic_input_methods/src/csv/gez-ET_gez-ER.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/gez-ET_gez-ER.csv rename to packages/ethiopic_input_methods/src/csv/gez-ET_gez-ER.csv diff --git a/packages/ethiopic-layouts/src/csv/har-ET.csv b/packages/ethiopic_input_methods/src/csv/har-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/har-ET.csv rename to packages/ethiopic_input_methods/src/csv/har-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/mym-ET_muz-ET_suq-ET_mdx-ET.csv b/packages/ethiopic_input_methods/src/csv/mym-ET_muz-ET_suq-ET_mdx-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/mym-ET_muz-ET_suq-ET_mdx-ET.csv rename to packages/ethiopic_input_methods/src/csv/mym-ET_muz-ET_suq-ET_mdx-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/punctuation.csv b/packages/ethiopic_input_methods/src/csv/punctuation.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/punctuation.csv rename to packages/ethiopic_input_methods/src/csv/punctuation.csv diff --git a/packages/ethiopic-layouts/src/csv/sgw-ET.csv b/packages/ethiopic_input_methods/src/csv/sgw-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/sgw-ET.csv rename to packages/ethiopic_input_methods/src/csv/sgw-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/ti-ER.csv b/packages/ethiopic_input_methods/src/csv/ti-ER.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/ti-ER.csv rename to packages/ethiopic_input_methods/src/csv/ti-ER.csv diff --git a/packages/ethiopic-layouts/src/csv/ti-ET.csv b/packages/ethiopic_input_methods/src/csv/ti-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/ti-ET.csv rename to packages/ethiopic_input_methods/src/csv/ti-ET.csv diff --git a/packages/ethiopic-layouts/src/csv/xst-ET.csv b/packages/ethiopic_input_methods/src/csv/xst-ET.csv similarity index 100% rename from packages/ethiopic-layouts/src/csv/xst-ET.csv rename to packages/ethiopic_input_methods/src/csv/xst-ET.csv diff --git a/packages/ethiopic_input_methods/src/generate-from-csv.ts b/packages/ethiopic_input_methods/src/generate-from-csv.ts new file mode 100644 index 0000000..ef02972 --- /dev/null +++ b/packages/ethiopic_input_methods/src/generate-from-csv.ts @@ -0,0 +1,54 @@ +import { generateMapForRow } from '@keywrite/input-method-generator'; +import csvParser from 'csv-parser'; +import fs from 'fs'; +import inputMethods from './input-methods'; +const punctuation = {}; +fs.createReadStream(`${__dirname}/csv/punctuation.csv`) + .pipe(csvParser()) + .on('data', (row) => { + generateMapForRow(punctuation, row); + }) + .on('end', () => { + console.log('inputMethod successfully generated for punctuation'); + }); +for (const [code, { name, path, regions }] of Object.entries(inputMethods)) { + const inputMethod = {}; + fs.createReadStream(`${__dirname}/csv/${path}.csv`) + .pipe(csvParser()) + .on('data', (row) => { + generateMapForRow(inputMethod, row); + }) + .on('end', () => { + console.log(`input method successfully generated for ${name}`); + const meta = { + name, + regions, + }; + + fs.writeFileSync( + `${__dirname}/${code}.ts`, + `import { InputMethod } from '@keywrite/core'; + import {InputMethodMeta, InputMethodSpec} from './interfaces'; + const inputMethod : InputMethodSpec = ${JSON.stringify({ + meta, + inputMethod: { ...inputMethod, ...punctuation }, + })}; + export default inputMethod; + `, + ); + }); +} +// write index indexFile +let index = ` +import { InputMethod } from '@keywrite/core'; +const inputMethods:Record = {};`; +for (const { path, name } of Object.values(inputMethods)) { + const inputMethod = name.replace(/[^a-zA-Z]/g, ''); + index += ` + import ${inputMethod} from './${path}'; + export {default as ${inputMethod}} from './${path}'; + inputMethods[${inputMethod}.meta.name] = ${inputMethod}.inputMethod; + `; +} +index += `export default inputMethods;`; +fs.writeFileSync(`${__dirname}/index.ts`, index); diff --git a/packages/ethiopic-layouts/src/gez-ET_gez-ER.ts b/packages/ethiopic_input_methods/src/gez-ET_gez-ER.ts similarity index 99% rename from packages/ethiopic-layouts/src/gez-ET_gez-ER.ts rename to packages/ethiopic_input_methods/src/gez-ET_gez-ER.ts index 062b2c8..c0a4173 100644 --- a/packages/ethiopic-layouts/src/gez-ET_gez-ER.ts +++ b/packages/ethiopic_input_methods/src/gez-ET_gez-ER.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: "Ge'ez", regions: ['gez-ET', 'gez-ER'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -874,4 +873,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/har-ET.ts b/packages/ethiopic_input_methods/src/har-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/har-ET.ts rename to packages/ethiopic_input_methods/src/har-ET.ts index 53caf8c..af8d17f 100644 --- a/packages/ethiopic-layouts/src/har-ET.ts +++ b/packages/ethiopic_input_methods/src/har-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Harari', regions: ['har-ET'] }, - layout: { + inputMethod: { h: { value: 'ሕ', next: { @@ -663,4 +662,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic_input_methods/src/index.ts b/packages/ethiopic_input_methods/src/index.ts new file mode 100644 index 0000000..6366f2c --- /dev/null +++ b/packages/ethiopic_input_methods/src/index.ts @@ -0,0 +1,46 @@ +import { InputMethod } from '@keywrite/core'; +const inputMethods: Record = {}; +import Amharic from './am-ET'; +export { default as Amharic } from './am-ET'; +inputMethods[Amharic.meta.name] = Amharic.inputMethod; + +import AwngiBlinXamtanga from './awn-ET_byn-ER_xan-ET'; +export { default as AwngiBlinXamtanga } from './awn-ET_byn-ER_xan-ET'; +inputMethods[AwngiBlinXamtanga.meta.name] = AwngiBlinXamtanga.inputMethod; + +import Bench from './bcq-ET'; +export { default as Bench } from './bcq-ET'; +inputMethods[Bench.meta.name] = Bench.inputMethod; + +import DiziMeenMursiSuri from './mym-ET_muz-ET_suq-ET_mdx-ET'; +export { default as DiziMeenMursiSuri } from './mym-ET_muz-ET_suq-ET_mdx-ET'; +inputMethods[DiziMeenMursiSuri.meta.name] = DiziMeenMursiSuri.inputMethod; + +import Geez from './gez-ET_gez-ER'; +export { default as Geez } from './gez-ET_gez-ER'; +inputMethods[Geez.meta.name] = Geez.inputMethod; + +import Harari from './har-ET'; +export { default as Harari } from './har-ET'; +inputMethods[Harari.meta.name] = Harari.inputMethod; + +import Sebatbeit from './sgw-ET'; +export { default as Sebatbeit } from './sgw-ET'; +inputMethods[Sebatbeit.meta.name] = Sebatbeit.inputMethod; + +import Silte from './xst-ET'; +export { default as Silte } from './xst-ET'; +inputMethods[Silte.meta.name] = Silte.inputMethod; + +import TigrinyaEritrean from './ti-ER'; +export { default as TigrinyaEritrean } from './ti-ER'; +inputMethods[TigrinyaEritrean.meta.name] = TigrinyaEritrean.inputMethod; + +import TigrinyaEthiopia from './ti-ET'; +export { default as TigrinyaEthiopia } from './ti-ET'; +inputMethods[TigrinyaEthiopia.meta.name] = TigrinyaEthiopia.inputMethod; + +import EthiopicLanguageNeutral from './ET'; +export { default as EthiopicLanguageNeutral } from './ET'; +inputMethods[EthiopicLanguageNeutral.meta.name] = EthiopicLanguageNeutral.inputMethod; +export default inputMethods; diff --git a/packages/ethiopic-layouts/src/layouts.ts b/packages/ethiopic_input_methods/src/input-methods.ts similarity index 61% rename from packages/ethiopic-layouts/src/layouts.ts rename to packages/ethiopic_input_methods/src/input-methods.ts index 510ab0b..485aab1 100644 --- a/packages/ethiopic-layouts/src/layouts.ts +++ b/packages/ethiopic_input_methods/src/input-methods.ts @@ -1,45 +1,55 @@ -type LayoutMeta = { path: string; name: string }; -const layouts: Record = { - 'am-ET': { path: 'am-ET', name: 'Amharic' }, +import { InputMethodMeta } from './interfaces'; +const inputMethods: Record = { + 'am-ET': { path: 'am-ET', name: 'Amharic', regions: ['am-ET'] }, 'awn-ET_byn-ER_xan-ET': { path: 'awn-ET_byn-ER_xan-ET', name: 'Awngi, Blin, Xamtanga', + regions: ['awn-ET', 'byn-ER', 'xan-ET'], }, 'bcq-ET': { path: 'bcq-ET', name: 'Bench', + regions: ['bcq-ET'], }, 'mym-ET_muz-ET_suq-ET_mdx-ET': { path: 'mym-ET_muz-ET_suq-ET_mdx-ET', name: "Dizi, Me'en, Mursi, Suri", + regions: ['mym-ET', 'muz-ET', 'suq-ET', 'mdx-ET'], }, 'gez-ET_gez-ER': { path: 'gez-ET_gez-ER', name: "Ge'ez", + regions: ['gez-ET', 'gez-ER'], }, 'har-ET': { path: 'har-ET', name: 'Harari', + regions: ['har-ET'], }, 'sgw-ET': { path: 'sgw-ET', name: 'Sebatbeit', + regions: ['sgw-ET'], }, 'xst-ET': { path: 'xst-ET', name: "Silt'e", + regions: ['xst-ET'], }, 'ti-ER': { path: 'ti-ER', name: 'Tigrinya(Eritrean)', + regions: ['ti-ER'], }, 'ti-ET': { path: 'ti-ET', name: 'Tigrinya(Ethiopia)', + regions: ['ti-ET'], }, ET: { path: 'ET', name: 'Ethiopic(Language Neutral)', + regions: ['ET'], }, }; -export default layouts; +export default inputMethods; diff --git a/packages/ethiopic_input_methods/src/interfaces.ts b/packages/ethiopic_input_methods/src/interfaces.ts new file mode 100644 index 0000000..2ebb6c9 --- /dev/null +++ b/packages/ethiopic_input_methods/src/interfaces.ts @@ -0,0 +1,3 @@ +import { InputMethod } from '@keywrite/core'; +export type InputMethodMeta = { path?: string; name: string; regions: string[] }; +export type InputMethodSpec = { meta: InputMethodMeta; inputMethod: InputMethod }; diff --git a/packages/ethiopic-layouts/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts b/packages/ethiopic_input_methods/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts rename to packages/ethiopic_input_methods/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts index 0e90654..fa13398 100644 --- a/packages/ethiopic-layouts/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts +++ b/packages/ethiopic_input_methods/src/mym-ET_muz-ET_suq-ET_mdx-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: "Dizi, Me'en, Mursi, Suri", regions: ['mym-ET', 'muz-ET', 'suq-ET', 'mdx-ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -648,4 +647,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/sgw-ET.ts b/packages/ethiopic_input_methods/src/sgw-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/sgw-ET.ts rename to packages/ethiopic_input_methods/src/sgw-ET.ts index bb5e92d..54929ec 100644 --- a/packages/ethiopic-layouts/src/sgw-ET.ts +++ b/packages/ethiopic_input_methods/src/sgw-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Sebatbeit', regions: ['sgw-ET'] }, - layout: { + inputMethod: { h: { value: 'ኽ', next: { @@ -1068,4 +1067,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/ti-ER.ts b/packages/ethiopic_input_methods/src/ti-ER.ts similarity index 99% rename from packages/ethiopic-layouts/src/ti-ER.ts rename to packages/ethiopic_input_methods/src/ti-ER.ts index ed80e2a..a2e509c 100644 --- a/packages/ethiopic-layouts/src/ti-ER.ts +++ b/packages/ethiopic_input_methods/src/ti-ER.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Tigrinya(Eritrean)', regions: ['ti-ER'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -826,4 +825,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/ti-ET.ts b/packages/ethiopic_input_methods/src/ti-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/ti-ET.ts rename to packages/ethiopic_input_methods/src/ti-ET.ts index e11db50..824e5c6 100644 --- a/packages/ethiopic-layouts/src/ti-ET.ts +++ b/packages/ethiopic_input_methods/src/ti-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: 'Tigrinya(Ethiopia)', regions: ['ti-ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -916,4 +915,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/src/xst-ET.ts b/packages/ethiopic_input_methods/src/xst-ET.ts similarity index 99% rename from packages/ethiopic-layouts/src/xst-ET.ts rename to packages/ethiopic_input_methods/src/xst-ET.ts index b992e1d..a247fd1 100644 --- a/packages/ethiopic-layouts/src/xst-ET.ts +++ b/packages/ethiopic_input_methods/src/xst-ET.ts @@ -1,9 +1,8 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { +import { InputMethod } from '@keywrite/core'; +import { InputMethodMeta, InputMethodSpec } from './interfaces'; +const inputMethod: InputMethodSpec = { meta: { name: "Silt'e", regions: ['xst-ET'] }, - layout: { + inputMethod: { h: { value: 'ህ', next: { @@ -663,4 +662,4 @@ const layout: LayoutSpec = { '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, }, }; -export default layout; +export default inputMethod; diff --git a/packages/ethiopic-layouts/tsconfig.json b/packages/ethiopic_input_methods/tsconfig.json similarity index 87% rename from packages/ethiopic-layouts/tsconfig.json rename to packages/ethiopic_input_methods/tsconfig.json index e2317b1..2aed2f4 100644 --- a/packages/ethiopic-layouts/tsconfig.json +++ b/packages/ethiopic_input_methods/tsconfig.json @@ -8,7 +8,7 @@ "exclude": ["src/layouts.ts", "src/generate-from-csv.ts"], "references": [ { - "path": "../layout-generator" + "path": "../input-method-generator" }, { "path": "../core" diff --git a/packages/input-method-generator/CHANGELOG.md b/packages/input-method-generator/CHANGELOG.md new file mode 100644 index 0000000..d237078 --- /dev/null +++ b/packages/input-method-generator/CHANGELOG.md @@ -0,0 +1,7 @@ +# @keywrite/layout-generator + +## 0.1.1 + +### Patch Changes + +- [`bc3cc2a`](https://github.com/eyuelberga/keywrite/commit/bc3cc2ac88eae4ed543c31e62a551c7d333f8990) [#1](https://github.com/eyuelberga/keywrite/pull/1) Thanks [@eyuelberga](https://github.com/eyuelberga)! - Initial release diff --git a/packages/input-method-generator/README.md b/packages/input-method-generator/README.md new file mode 100644 index 0000000..c2c2067 --- /dev/null +++ b/packages/input-method-generator/README.md @@ -0,0 +1 @@ +## @keywrite/input-method-generator diff --git a/packages/layout-generator/jest.config.js b/packages/input-method-generator/jest.config.js similarity index 100% rename from packages/layout-generator/jest.config.js rename to packages/input-method-generator/jest.config.js diff --git a/packages/layout-generator/package.json b/packages/input-method-generator/package.json similarity index 85% rename from packages/layout-generator/package.json rename to packages/input-method-generator/package.json index 16efae6..2cd1f22 100644 --- a/packages/layout-generator/package.json +++ b/packages/input-method-generator/package.json @@ -1,12 +1,12 @@ { - "name": "@keywrite/layout-generator", + "name": "@keywrite/input-method-generator", "version": "0.1.1", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", "repository": { "type": "git", - "directory": "packages/layout-generator", + "directory": "packages/input-method-generator", "url": "https://github.com/eyuelberga/keywrite.git" }, "scripts": { diff --git a/packages/layout-generator/src/core.ts b/packages/input-method-generator/src/core.ts similarity index 76% rename from packages/layout-generator/src/core.ts rename to packages/input-method-generator/src/core.ts index 2cc6f16..a029b57 100644 --- a/packages/layout-generator/src/core.ts +++ b/packages/input-method-generator/src/core.ts @@ -1,6 +1,6 @@ import { toSequence, setDeep, toPath } from './utils'; import { ObjectPath } from './interfaces'; -import { KeyboardLayout } from '@keywrite/core'; +import { InputMethod } from '@keywrite/core'; const generateKeymap = (keys: string[]) => { const keymap: Record = {}; keys.forEach((key) => { @@ -14,26 +14,26 @@ const filterKeys = (row: Record, keyCol: string, defaultCol: str return k !== keyCol && k !== defaultCol && row[k].trim(); }); }; -const setSymbolMap = (layout: KeyboardLayout, value: string, path: ObjectPath): void => { +const setSymbolMap = (inputMethod: InputMethod, value: string, path: ObjectPath): void => { const symbolMap = { value, next: null }; - setDeep(layout, path, symbolMap); + setDeep(inputMethod, path, symbolMap); }; export const generateMapForRow = ( - layout: KeyboardLayout, + inputMethod: InputMethod, row: Record, keyCol = 'KEY', defaultCol = '_', ): void => { const primaryPaths = toPath(toSequence(row[keyCol])); for (const primary of primaryPaths) { - setSymbolMap(layout, row[defaultCol], `${primary}`); + setSymbolMap(inputMethod, row[defaultCol], `${primary}`); const relevantKeys = filterKeys(row, keyCol, defaultCol); const keymap = generateKeymap(relevantKeys); for (const key of relevantKeys) { const paths = toPath(keymap[key], primary); for (const path of paths) { - setSymbolMap(layout, row[key], path); + setSymbolMap(inputMethod, row[key], path); } } } diff --git a/packages/layout-generator/src/index.ts b/packages/input-method-generator/src/index.ts similarity index 100% rename from packages/layout-generator/src/index.ts rename to packages/input-method-generator/src/index.ts diff --git a/packages/layout-generator/src/interfaces.ts b/packages/input-method-generator/src/interfaces.ts similarity index 100% rename from packages/layout-generator/src/interfaces.ts rename to packages/input-method-generator/src/interfaces.ts diff --git a/packages/layout-generator/src/utils.ts b/packages/input-method-generator/src/utils.ts similarity index 100% rename from packages/layout-generator/src/utils.ts rename to packages/input-method-generator/src/utils.ts diff --git a/packages/layout-generator/tests/core.spec.ts b/packages/input-method-generator/tests/core.spec.ts similarity index 100% rename from packages/layout-generator/tests/core.spec.ts rename to packages/input-method-generator/tests/core.spec.ts diff --git a/packages/layout-generator/tests/utils.spec.ts b/packages/input-method-generator/tests/utils.spec.ts similarity index 100% rename from packages/layout-generator/tests/utils.spec.ts rename to packages/input-method-generator/tests/utils.spec.ts diff --git a/packages/layout-generator/tsconfig.json b/packages/input-method-generator/tsconfig.json similarity index 100% rename from packages/layout-generator/tsconfig.json rename to packages/input-method-generator/tsconfig.json diff --git a/packages/layout-generator/CHANGELOG.md b/packages/layout-generator/CHANGELOG.md deleted file mode 100644 index 100d146..0000000 --- a/packages/layout-generator/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# @keywrite/layout-generator - -## 0.1.1 -### Patch Changes - - - -- [`bc3cc2a`](https://github.com/eyuelberga/keywrite/commit/bc3cc2ac88eae4ed543c31e62a551c7d333f8990) [#1](https://github.com/eyuelberga/keywrite/pull/1) Thanks [@eyuelberga](https://github.com/eyuelberga)! - Initial release diff --git a/packages/layout-generator/README.md b/packages/layout-generator/README.md deleted file mode 100644 index 0d4cf76..0000000 --- a/packages/layout-generator/README.md +++ /dev/null @@ -1 +0,0 @@ -## @keywrite/layout-generator diff --git a/packages/web/README.md b/packages/web/README.md index d15f97b..175a5e0 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -17,7 +17,7 @@ $ npm install @keywrite/web ```javascript import { KeywriteWeb } from '@keywrite/web'; -// keyboard layout definition +// input method definition import layout from './layout'; // add to HTMLInputElement diff --git a/packages/web/src/ET.ts b/packages/web/src/ET.ts deleted file mode 100644 index cf5694d..0000000 --- a/packages/web/src/ET.ts +++ /dev/null @@ -1,1258 +0,0 @@ -import { KeyboardLayout } from '@keywrite/core'; -type LayoutMeta = { name: string; regions: string[] }; -type LayoutSpec = { meta: LayoutMeta; layout: KeyboardLayout }; -const layout: LayoutSpec = { - meta: { name: 'Ethiopic(Language Neutral)', regions: ['ET'] }, - layout: { - h: { - value: 'ህ', - next: { - e: { value: 'ሀ', next: null }, - E: { value: 'ሀ', next: null }, - u: { - value: 'ሁ', - next: { - e: { value: 'ኈ', next: null }, - E: { value: 'ኈ', next: null }, - u: { value: 'ኍ', next: null }, - U: { value: 'ኍ', next: null }, - i: { value: 'ኊ', next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } } }, - I: { value: 'ኊ', next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } } }, - a: { value: 'ኋ', next: null }, - A: { value: 'ኋ', next: null }, - }, - }, - U: { - value: 'ሁ', - next: { - e: { value: 'ኈ', next: null }, - E: { value: 'ኈ', next: null }, - u: { value: 'ኍ', next: null }, - U: { value: 'ኍ', next: null }, - i: { value: 'ኊ', next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } } }, - I: { value: 'ኊ', next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } } }, - a: { value: 'ኋ', next: null }, - A: { value: 'ኋ', next: null }, - }, - }, - i: { value: 'ሂ', next: { e: { value: 'ሄ', next: null }, E: { value: 'ሄ', next: null } } }, - I: { value: 'ሂ', next: { e: { value: 'ሄ', next: null }, E: { value: 'ሄ', next: null } } }, - a: { value: 'ሃ', next: null }, - A: { value: 'ሃ', next: null }, - o: { value: 'ሆ', next: { a: { value: 'ሇ', next: null }, A: { value: 'ሇ', next: null } } }, - O: { value: 'ሆ', next: { a: { value: 'ሇ', next: null }, A: { value: 'ሇ', next: null } } }, - h: { - value: 'ኅ', - next: { - e: { value: 'ኀ', next: null }, - E: { value: 'ኀ', next: null }, - u: { - value: 'ኁ', - next: { - e: { value: 'ኈ', next: null }, - E: { value: 'ኈ', next: null }, - u: { value: 'ኍ', next: null }, - U: { value: 'ኍ', next: null }, - i: { - value: 'ኊ', - next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } }, - }, - I: { - value: 'ኊ', - next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } }, - }, - a: { value: 'ኋ', next: null }, - A: { value: 'ኋ', next: null }, - }, - }, - U: { - value: 'ኁ', - next: { - e: { value: 'ኈ', next: null }, - E: { value: 'ኈ', next: null }, - u: { value: 'ኍ', next: null }, - U: { value: 'ኍ', next: null }, - i: { - value: 'ኊ', - next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } }, - }, - I: { - value: 'ኊ', - next: { e: { value: 'ኌ', next: null }, E: { value: 'ኌ', next: null } }, - }, - a: { value: 'ኋ', next: null }, - A: { value: 'ኋ', next: null }, - }, - }, - i: { value: 'ኂ', next: { e: { value: 'ኄ', next: null }, E: { value: 'ኄ', next: null } } }, - I: { value: 'ኂ', next: { e: { value: 'ኄ', next: null }, E: { value: 'ኄ', next: null } } }, - a: { value: 'ኃ', next: null }, - A: { value: 'ኃ', next: null }, - o: { value: 'ኆ', next: { a: { value: 'ኇ', next: null }, A: { value: 'ኇ', next: null } } }, - O: { value: 'ኆ', next: { a: { value: 'ኇ', next: null }, A: { value: 'ኇ', next: null } } }, - }, - }, - }, - }, - l: { - value: 'ል', - next: { - e: { value: 'ለ', next: null }, - E: { value: 'ለ', next: null }, - u: { value: 'ሉ', next: { a: { value: 'ሏ', next: null }, A: { value: 'ሏ', next: null } } }, - U: { value: 'ሉ', next: { a: { value: 'ሏ', next: null }, A: { value: 'ሏ', next: null } } }, - i: { value: 'ሊ', next: { e: { value: 'ሌ', next: null }, E: { value: 'ሌ', next: null } } }, - I: { value: 'ሊ', next: { e: { value: 'ሌ', next: null }, E: { value: 'ሌ', next: null } } }, - a: { value: 'ላ', next: null }, - A: { value: 'ላ', next: null }, - o: { value: 'ሎ', next: { a: { value: 'ⶀ', next: null }, A: { value: 'ⶀ', next: null } } }, - O: { value: 'ሎ', next: { a: { value: 'ⶀ', next: null }, A: { value: 'ⶀ', next: null } } }, - }, - }, - L: { - value: 'ል', - next: { - e: { value: 'ለ', next: null }, - E: { value: 'ለ', next: null }, - u: { value: 'ሉ', next: { a: { value: 'ሏ', next: null }, A: { value: 'ሏ', next: null } } }, - U: { value: 'ሉ', next: { a: { value: 'ሏ', next: null }, A: { value: 'ሏ', next: null } } }, - i: { value: 'ሊ', next: { e: { value: 'ሌ', next: null }, E: { value: 'ሌ', next: null } } }, - I: { value: 'ሊ', next: { e: { value: 'ሌ', next: null }, E: { value: 'ሌ', next: null } } }, - a: { value: 'ላ', next: null }, - A: { value: 'ላ', next: null }, - o: { value: 'ሎ', next: { a: { value: 'ⶀ', next: null }, A: { value: 'ⶀ', next: null } } }, - O: { value: 'ሎ', next: { a: { value: 'ⶀ', next: null }, A: { value: 'ⶀ', next: null } } }, - }, - }, - H: { - value: 'ሕ', - next: { - e: { value: 'ሐ', next: null }, - E: { value: 'ሐ', next: null }, - u: { value: 'ሑ', next: { a: { value: 'ሗ', next: null }, A: { value: 'ሗ', next: null } } }, - U: { value: 'ሑ', next: { a: { value: 'ሗ', next: null }, A: { value: 'ሗ', next: null } } }, - i: { value: 'ሒ', next: { e: { value: 'ሔ', next: null }, E: { value: 'ሔ', next: null } } }, - I: { value: 'ሒ', next: { e: { value: 'ሔ', next: null }, E: { value: 'ሔ', next: null } } }, - a: { value: 'ሓ', next: null }, - A: { value: 'ሓ', next: null }, - o: { value: 'ሖ', next: null }, - O: { value: 'ሖ', next: null }, - }, - }, - m: { - value: 'ም', - next: { - e: { value: 'መ', next: null }, - E: { value: 'መ', next: null }, - u: { - value: 'ሙ', - next: { - e: { value: 'ᎀ', next: null }, - E: { value: 'ᎀ', next: null }, - u: { value: 'ᎃ', next: null }, - U: { value: 'ᎃ', next: null }, - i: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - I: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - a: { value: 'ሟ', next: null }, - A: { value: 'ሟ', next: null }, - }, - }, - U: { - value: 'ሙ', - next: { - e: { value: 'ᎀ', next: null }, - E: { value: 'ᎀ', next: null }, - u: { value: 'ᎃ', next: null }, - U: { value: 'ᎃ', next: null }, - i: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - I: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - a: { value: 'ሟ', next: null }, - A: { value: 'ሟ', next: null }, - }, - }, - i: { value: 'ሚ', next: { e: { value: 'ሜ', next: null }, E: { value: 'ሜ', next: null } } }, - I: { value: 'ሚ', next: { e: { value: 'ሜ', next: null }, E: { value: 'ሜ', next: null } } }, - a: { value: 'ማ', next: null }, - A: { value: 'ማ', next: null }, - o: { value: 'ሞ', next: { a: { value: 'ⶁ', next: null }, A: { value: 'ⶁ', next: null } } }, - O: { value: 'ሞ', next: { a: { value: 'ⶁ', next: null }, A: { value: 'ⶁ', next: null } } }, - Y: { value: 'ፙ', next: null }, - }, - }, - M: { - value: 'ም', - next: { - e: { value: 'መ', next: null }, - E: { value: 'መ', next: null }, - u: { - value: 'ሙ', - next: { - e: { value: 'ᎀ', next: null }, - E: { value: 'ᎀ', next: null }, - u: { value: 'ᎃ', next: null }, - U: { value: 'ᎃ', next: null }, - i: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - I: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - a: { value: 'ሟ', next: null }, - A: { value: 'ሟ', next: null }, - }, - }, - U: { - value: 'ሙ', - next: { - e: { value: 'ᎀ', next: null }, - E: { value: 'ᎀ', next: null }, - u: { value: 'ᎃ', next: null }, - U: { value: 'ᎃ', next: null }, - i: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - I: { value: 'ᎁ', next: { e: { value: 'ᎂ', next: null }, E: { value: 'ᎂ', next: null } } }, - a: { value: 'ሟ', next: null }, - A: { value: 'ሟ', next: null }, - }, - }, - i: { value: 'ሚ', next: { e: { value: 'ሜ', next: null }, E: { value: 'ሜ', next: null } } }, - I: { value: 'ሚ', next: { e: { value: 'ሜ', next: null }, E: { value: 'ሜ', next: null } } }, - a: { value: 'ማ', next: null }, - A: { value: 'ማ', next: null }, - o: { value: 'ሞ', next: { a: { value: 'ⶁ', next: null }, A: { value: 'ⶁ', next: null } } }, - O: { value: 'ሞ', next: { a: { value: 'ⶁ', next: null }, A: { value: 'ⶁ', next: null } } }, - Y: { value: 'ፙ', next: null }, - }, - }, - s: { - value: 'ስ', - next: { - e: { value: 'ሰ', next: null }, - E: { value: 'ሰ', next: null }, - u: { value: 'ሱ', next: { a: { value: 'ሷ', next: null }, A: { value: 'ሷ', next: null } } }, - U: { value: 'ሱ', next: { a: { value: 'ሷ', next: null }, A: { value: 'ሷ', next: null } } }, - i: { value: 'ሲ', next: { e: { value: 'ሴ', next: null }, E: { value: 'ሴ', next: null } } }, - I: { value: 'ሲ', next: { e: { value: 'ሴ', next: null }, E: { value: 'ሴ', next: null } } }, - a: { value: 'ሳ', next: null }, - A: { value: 'ሳ', next: null }, - o: { value: 'ሶ', next: { a: { value: 'ⶃ', next: null }, A: { value: 'ⶃ', next: null } } }, - O: { value: 'ሶ', next: { a: { value: 'ⶃ', next: null }, A: { value: 'ⶃ', next: null } } }, - }, - }, - r: { - value: 'ር', - next: { - e: { value: 'ረ', next: null }, - E: { value: 'ረ', next: null }, - u: { value: 'ሩ', next: { a: { value: 'ሯ', next: null }, A: { value: 'ሯ', next: null } } }, - U: { value: 'ሩ', next: { a: { value: 'ሯ', next: null }, A: { value: 'ሯ', next: null } } }, - i: { value: 'ሪ', next: { e: { value: 'ሬ', next: null }, E: { value: 'ሬ', next: null } } }, - I: { value: 'ሪ', next: { e: { value: 'ሬ', next: null }, E: { value: 'ሬ', next: null } } }, - a: { value: 'ራ', next: null }, - A: { value: 'ራ', next: null }, - o: { value: 'ሮ', next: { a: { value: 'ⶂ', next: null }, A: { value: 'ⶂ', next: null } } }, - O: { value: 'ሮ', next: { a: { value: 'ⶂ', next: null }, A: { value: 'ⶂ', next: null } } }, - Y: { value: 'ፘ', next: null }, - }, - }, - R: { - value: 'ር', - next: { - e: { value: 'ረ', next: null }, - E: { value: 'ረ', next: null }, - u: { value: 'ሩ', next: { a: { value: 'ሯ', next: null }, A: { value: 'ሯ', next: null } } }, - U: { value: 'ሩ', next: { a: { value: 'ሯ', next: null }, A: { value: 'ሯ', next: null } } }, - i: { value: 'ሪ', next: { e: { value: 'ሬ', next: null }, E: { value: 'ሬ', next: null } } }, - I: { value: 'ሪ', next: { e: { value: 'ሬ', next: null }, E: { value: 'ሬ', next: null } } }, - a: { value: 'ራ', next: null }, - A: { value: 'ራ', next: null }, - o: { value: 'ሮ', next: { a: { value: 'ⶂ', next: null }, A: { value: 'ⶂ', next: null } } }, - O: { value: 'ሮ', next: { a: { value: 'ⶂ', next: null }, A: { value: 'ⶂ', next: null } } }, - Y: { value: 'ፘ', next: null }, - }, - }, - x: { - value: 'ሽ', - next: { - e: { value: 'ሸ', next: null }, - E: { value: 'ሸ', next: null }, - u: { value: 'ሹ', next: { a: { value: 'ሿ', next: null }, A: { value: 'ሿ', next: null } } }, - U: { value: 'ሹ', next: { a: { value: 'ሿ', next: null }, A: { value: 'ሿ', next: null } } }, - i: { value: 'ሺ', next: { e: { value: 'ሼ', next: null }, E: { value: 'ሼ', next: null } } }, - I: { value: 'ሺ', next: { e: { value: 'ሼ', next: null }, E: { value: 'ሼ', next: null } } }, - a: { value: 'ሻ', next: null }, - A: { value: 'ሻ', next: null }, - o: { value: 'ሾ', next: { a: { value: 'ⶄ', next: null }, A: { value: 'ⶄ', next: null } } }, - O: { value: 'ሾ', next: { a: { value: 'ⶄ', next: null }, A: { value: 'ⶄ', next: null } } }, - x: { - value: 'ⶥ', - next: { - e: { value: 'ⶠ', next: null }, - E: { value: 'ⶠ', next: null }, - u: { value: 'ⶡ', next: null }, - U: { value: 'ⶡ', next: null }, - i: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - I: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - a: { value: 'ⶣ', next: null }, - A: { value: 'ⶣ', next: null }, - o: { value: 'ⶦ', next: null }, - O: { value: 'ⶦ', next: null }, - }, - }, - X: { - value: 'ⶥ', - next: { - e: { value: 'ⶠ', next: null }, - E: { value: 'ⶠ', next: null }, - u: { value: 'ⶡ', next: null }, - U: { value: 'ⶡ', next: null }, - i: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - I: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - a: { value: 'ⶣ', next: null }, - A: { value: 'ⶣ', next: null }, - o: { value: 'ⶦ', next: null }, - O: { value: 'ⶦ', next: null }, - }, - }, - }, - }, - X: { - value: 'ሽ', - next: { - e: { value: 'ሸ', next: null }, - E: { value: 'ሸ', next: null }, - u: { value: 'ሹ', next: { a: { value: 'ሿ', next: null }, A: { value: 'ሿ', next: null } } }, - U: { value: 'ሹ', next: { a: { value: 'ሿ', next: null }, A: { value: 'ሿ', next: null } } }, - i: { value: 'ሺ', next: { e: { value: 'ሼ', next: null }, E: { value: 'ሼ', next: null } } }, - I: { value: 'ሺ', next: { e: { value: 'ሼ', next: null }, E: { value: 'ሼ', next: null } } }, - a: { value: 'ሻ', next: null }, - A: { value: 'ሻ', next: null }, - o: { value: 'ሾ', next: { a: { value: 'ⶄ', next: null }, A: { value: 'ⶄ', next: null } } }, - O: { value: 'ሾ', next: { a: { value: 'ⶄ', next: null }, A: { value: 'ⶄ', next: null } } }, - x: { - value: 'ⶥ', - next: { - e: { value: 'ⶠ', next: null }, - E: { value: 'ⶠ', next: null }, - u: { value: 'ⶡ', next: null }, - U: { value: 'ⶡ', next: null }, - i: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - I: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - a: { value: 'ⶣ', next: null }, - A: { value: 'ⶣ', next: null }, - o: { value: 'ⶦ', next: null }, - O: { value: 'ⶦ', next: null }, - }, - }, - X: { - value: 'ⶥ', - next: { - e: { value: 'ⶠ', next: null }, - E: { value: 'ⶠ', next: null }, - u: { value: 'ⶡ', next: null }, - U: { value: 'ⶡ', next: null }, - i: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - I: { value: 'ⶢ', next: { e: { value: 'ⶤ', next: null }, E: { value: 'ⶤ', next: null } } }, - a: { value: 'ⶣ', next: null }, - A: { value: 'ⶣ', next: null }, - o: { value: 'ⶦ', next: null }, - O: { value: 'ⶦ', next: null }, - }, - }, - }, - }, - q: { - value: 'ቅ', - next: { - e: { value: 'ቀ', next: null }, - E: { value: 'ቀ', next: null }, - u: { - value: 'ቁ', - next: { - e: { value: 'ቈ', next: null }, - E: { value: 'ቈ', next: null }, - u: { value: 'ቍ', next: null }, - U: { value: 'ቍ', next: null }, - i: { value: 'ቊ', next: { e: { value: 'ቌ', next: null }, E: { value: 'ቌ', next: null } } }, - I: { value: 'ቊ', next: { e: { value: 'ቌ', next: null }, E: { value: 'ቌ', next: null } } }, - a: { value: 'ቋ', next: null }, - A: { value: 'ቋ', next: null }, - }, - }, - U: { - value: 'ቁ', - next: { - e: { value: 'ቈ', next: null }, - E: { value: 'ቈ', next: null }, - u: { value: 'ቍ', next: null }, - U: { value: 'ቍ', next: null }, - i: { value: 'ቊ', next: { e: { value: 'ቌ', next: null }, E: { value: 'ቌ', next: null } } }, - I: { value: 'ቊ', next: { e: { value: 'ቌ', next: null }, E: { value: 'ቌ', next: null } } }, - a: { value: 'ቋ', next: null }, - A: { value: 'ቋ', next: null }, - }, - }, - i: { value: 'ቂ', next: { e: { value: 'ቄ', next: null }, E: { value: 'ቄ', next: null } } }, - I: { value: 'ቂ', next: { e: { value: 'ቄ', next: null }, E: { value: 'ቄ', next: null } } }, - a: { value: 'ቃ', next: null }, - A: { value: 'ቃ', next: null }, - o: { value: 'ቆ', next: { a: { value: 'ቇ', next: null }, A: { value: 'ቇ', next: null } } }, - O: { value: 'ቆ', next: { a: { value: 'ቇ', next: null }, A: { value: 'ቇ', next: null } } }, - Y: { - value: 'ⷅ', - next: { - e: { value: 'ⷀ', next: null }, - E: { value: 'ⷀ', next: null }, - u: { value: 'ⷁ', next: null }, - U: { value: 'ⷁ', next: null }, - i: { value: 'ⷂ', next: { e: { value: 'ⷄ', next: null }, E: { value: 'ⷄ', next: null } } }, - I: { value: 'ⷂ', next: { e: { value: 'ⷄ', next: null }, E: { value: 'ⷄ', next: null } } }, - a: { value: 'ⷃ', next: null }, - A: { value: 'ⷃ', next: null }, - o: { value: 'ⷆ', next: null }, - O: { value: 'ⷆ', next: null }, - }, - }, - }, - }, - Q: { - value: 'ቕ', - next: { - e: { value: 'ቐ', next: null }, - E: { value: 'ቐ', next: null }, - u: { - value: 'ቑ', - next: { - e: { value: 'ቘ', next: null }, - E: { value: 'ቘ', next: null }, - u: { value: 'ቝ', next: null }, - U: { value: 'ቝ', next: null }, - i: { value: 'ቚ', next: { e: { value: 'ቜ', next: null }, E: { value: 'ቜ', next: null } } }, - I: { value: 'ቚ', next: { e: { value: 'ቜ', next: null }, E: { value: 'ቜ', next: null } } }, - a: { value: 'ቛ', next: null }, - A: { value: 'ቛ', next: null }, - }, - }, - U: { - value: 'ቑ', - next: { - e: { value: 'ቘ', next: null }, - E: { value: 'ቘ', next: null }, - u: { value: 'ቝ', next: null }, - U: { value: 'ቝ', next: null }, - i: { value: 'ቚ', next: { e: { value: 'ቜ', next: null }, E: { value: 'ቜ', next: null } } }, - I: { value: 'ቚ', next: { e: { value: 'ቜ', next: null }, E: { value: 'ቜ', next: null } } }, - a: { value: 'ቛ', next: null }, - A: { value: 'ቛ', next: null }, - }, - }, - i: { value: 'ቒ', next: { e: { value: 'ቔ', next: null }, E: { value: 'ቔ', next: null } } }, - I: { value: 'ቒ', next: { e: { value: 'ቔ', next: null }, E: { value: 'ቔ', next: null } } }, - a: { value: 'ቓ', next: null }, - A: { value: 'ቓ', next: null }, - o: { value: 'ቖ', next: null }, - O: { value: 'ቖ', next: null }, - }, - }, - b: { - value: 'ብ', - next: { - e: { value: 'በ', next: null }, - E: { value: 'በ', next: null }, - u: { - value: 'ቡ', - next: { - e: { value: 'ᎄ', next: null }, - E: { value: 'ᎄ', next: null }, - u: { value: 'ᎇ', next: null }, - U: { value: 'ᎇ', next: null }, - i: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - I: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - a: { value: 'ቧ', next: null }, - A: { value: 'ቧ', next: null }, - }, - }, - U: { - value: 'ቡ', - next: { - e: { value: 'ᎄ', next: null }, - E: { value: 'ᎄ', next: null }, - u: { value: 'ᎇ', next: null }, - U: { value: 'ᎇ', next: null }, - i: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - I: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - a: { value: 'ቧ', next: null }, - A: { value: 'ቧ', next: null }, - }, - }, - i: { value: 'ቢ', next: { e: { value: 'ቤ', next: null }, E: { value: 'ቤ', next: null } } }, - I: { value: 'ቢ', next: { e: { value: 'ቤ', next: null }, E: { value: 'ቤ', next: null } } }, - a: { value: 'ባ', next: null }, - A: { value: 'ባ', next: null }, - o: { value: 'ቦ', next: { a: { value: 'ⶅ', next: null }, A: { value: 'ⶅ', next: null } } }, - O: { value: 'ቦ', next: { a: { value: 'ⶅ', next: null }, A: { value: 'ⶅ', next: null } } }, - }, - }, - B: { - value: 'ብ', - next: { - e: { value: 'በ', next: null }, - E: { value: 'በ', next: null }, - u: { - value: 'ቡ', - next: { - e: { value: 'ᎄ', next: null }, - E: { value: 'ᎄ', next: null }, - u: { value: 'ᎇ', next: null }, - U: { value: 'ᎇ', next: null }, - i: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - I: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - a: { value: 'ቧ', next: null }, - A: { value: 'ቧ', next: null }, - }, - }, - U: { - value: 'ቡ', - next: { - e: { value: 'ᎄ', next: null }, - E: { value: 'ᎄ', next: null }, - u: { value: 'ᎇ', next: null }, - U: { value: 'ᎇ', next: null }, - i: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - I: { value: 'ᎅ', next: { e: { value: 'ᎆ', next: null }, E: { value: 'ᎆ', next: null } } }, - a: { value: 'ቧ', next: null }, - A: { value: 'ቧ', next: null }, - }, - }, - i: { value: 'ቢ', next: { e: { value: 'ቤ', next: null }, E: { value: 'ቤ', next: null } } }, - I: { value: 'ቢ', next: { e: { value: 'ቤ', next: null }, E: { value: 'ቤ', next: null } } }, - a: { value: 'ባ', next: null }, - A: { value: 'ባ', next: null }, - o: { value: 'ቦ', next: { a: { value: 'ⶅ', next: null }, A: { value: 'ⶅ', next: null } } }, - O: { value: 'ቦ', next: { a: { value: 'ⶅ', next: null }, A: { value: 'ⶅ', next: null } } }, - }, - }, - v: { - value: 'ቭ', - next: { - e: { value: 'ቨ', next: null }, - E: { value: 'ቨ', next: null }, - u: { value: 'ቩ', next: { a: { value: 'ቯ', next: null }, A: { value: 'ቯ', next: null } } }, - U: { value: 'ቩ', next: { a: { value: 'ቯ', next: null }, A: { value: 'ቯ', next: null } } }, - i: { value: 'ቪ', next: { e: { value: 'ቬ', next: null }, E: { value: 'ቬ', next: null } } }, - I: { value: 'ቪ', next: { e: { value: 'ቬ', next: null }, E: { value: 'ቬ', next: null } } }, - a: { value: 'ቫ', next: null }, - A: { value: 'ቫ', next: null }, - o: { value: 'ቮ', next: null }, - O: { value: 'ቮ', next: null }, - }, - }, - V: { - value: 'ቭ', - next: { - e: { value: 'ቨ', next: null }, - E: { value: 'ቨ', next: null }, - u: { value: 'ቩ', next: { a: { value: 'ቯ', next: null }, A: { value: 'ቯ', next: null } } }, - U: { value: 'ቩ', next: { a: { value: 'ቯ', next: null }, A: { value: 'ቯ', next: null } } }, - i: { value: 'ቪ', next: { e: { value: 'ቬ', next: null }, E: { value: 'ቬ', next: null } } }, - I: { value: 'ቪ', next: { e: { value: 'ቬ', next: null }, E: { value: 'ቬ', next: null } } }, - a: { value: 'ቫ', next: null }, - A: { value: 'ቫ', next: null }, - o: { value: 'ቮ', next: null }, - O: { value: 'ቮ', next: null }, - }, - }, - t: { - value: 'ት', - next: { - e: { value: 'ተ', next: null }, - E: { value: 'ተ', next: null }, - u: { value: 'ቱ', next: { a: { value: 'ቷ', next: null }, A: { value: 'ቷ', next: null } } }, - U: { value: 'ቱ', next: { a: { value: 'ቷ', next: null }, A: { value: 'ቷ', next: null } } }, - i: { value: 'ቲ', next: { e: { value: 'ቴ', next: null }, E: { value: 'ቴ', next: null } } }, - I: { value: 'ቲ', next: { e: { value: 'ቴ', next: null }, E: { value: 'ቴ', next: null } } }, - a: { value: 'ታ', next: null }, - A: { value: 'ታ', next: null }, - o: { value: 'ቶ', next: { a: { value: 'ⶆ', next: null }, A: { value: 'ⶆ', next: null } } }, - O: { value: 'ቶ', next: { a: { value: 'ⶆ', next: null }, A: { value: 'ⶆ', next: null } } }, - }, - }, - c: { - value: 'ች', - next: { - e: { value: 'ቸ', next: null }, - E: { value: 'ቸ', next: null }, - u: { value: 'ቹ', next: { a: { value: 'ቿ', next: null }, A: { value: 'ቿ', next: null } } }, - U: { value: 'ቹ', next: { a: { value: 'ቿ', next: null }, A: { value: 'ቿ', next: null } } }, - i: { value: 'ቺ', next: { e: { value: 'ቼ', next: null }, E: { value: 'ቼ', next: null } } }, - I: { value: 'ቺ', next: { e: { value: 'ቼ', next: null }, E: { value: 'ቼ', next: null } } }, - a: { value: 'ቻ', next: null }, - A: { value: 'ቻ', next: null }, - o: { value: 'ቾ', next: { a: { value: 'ⶇ', next: null }, A: { value: 'ⶇ', next: null } } }, - O: { value: 'ቾ', next: { a: { value: 'ⶇ', next: null }, A: { value: 'ⶇ', next: null } } }, - c: { - value: 'ⶭ', - next: { - e: { value: 'ⶨ', next: null }, - E: { value: 'ⶨ', next: null }, - u: { value: 'ⶩ', next: null }, - U: { value: 'ⶩ', next: null }, - i: { value: 'ⶪ', next: { e: { value: 'ⶬ', next: null }, E: { value: 'ⶬ', next: null } } }, - I: { value: 'ⶪ', next: { e: { value: 'ⶬ', next: null }, E: { value: 'ⶬ', next: null } } }, - a: { value: 'ⶫ', next: null }, - A: { value: 'ⶫ', next: null }, - o: { value: 'ⶮ', next: null }, - O: { value: 'ⶮ', next: null }, - }, - }, - }, - }, - n: { - value: 'ን', - next: { - e: { value: 'ነ', next: null }, - E: { value: 'ነ', next: null }, - u: { value: 'ኑ', next: { a: { value: 'ኗ', next: null }, A: { value: 'ኗ', next: null } } }, - U: { value: 'ኑ', next: { a: { value: 'ኗ', next: null }, A: { value: 'ኗ', next: null } } }, - i: { value: 'ኒ', next: { e: { value: 'ኔ', next: null }, E: { value: 'ኔ', next: null } } }, - I: { value: 'ኒ', next: { e: { value: 'ኔ', next: null }, E: { value: 'ኔ', next: null } } }, - a: { value: 'ና', next: null }, - A: { value: 'ና', next: null }, - o: { value: 'ኖ', next: { a: { value: 'ⶈ', next: null }, A: { value: 'ⶈ', next: null } } }, - O: { value: 'ኖ', next: { a: { value: 'ⶈ', next: null }, A: { value: 'ⶈ', next: null } } }, - }, - }, - N: { - value: 'ኝ', - next: { - e: { value: 'ኘ', next: null }, - E: { value: 'ኘ', next: null }, - u: { value: 'ኙ', next: { a: { value: 'ኟ', next: null }, A: { value: 'ኟ', next: null } } }, - U: { value: 'ኙ', next: { a: { value: 'ኟ', next: null }, A: { value: 'ኟ', next: null } } }, - i: { value: 'ኚ', next: { e: { value: 'ኜ', next: null }, E: { value: 'ኜ', next: null } } }, - I: { value: 'ኚ', next: { e: { value: 'ኜ', next: null }, E: { value: 'ኜ', next: null } } }, - a: { value: 'ኛ', next: null }, - A: { value: 'ኛ', next: null }, - o: { value: 'ኞ', next: { a: { value: 'ⶉ', next: null }, A: { value: 'ⶉ', next: null } } }, - O: { value: 'ኞ', next: { a: { value: 'ⶉ', next: null }, A: { value: 'ⶉ', next: null } } }, - }, - }, - a: { - value: 'እ', - next: { - e: { value: '', next: { e: { value: 'ኧ', next: null }, E: { value: 'ኧ', next: null } } }, - E: { value: 'አ', next: null }, - u: { value: 'ኡ', next: null }, - U: { value: 'ኡ', next: null }, - i: { value: 'ኢ', next: { e: { value: 'ኤ', next: null }, E: { value: 'ኤ', next: null } } }, - I: { value: 'ኢ', next: { e: { value: 'ኤ', next: null }, E: { value: 'ኤ', next: null } } }, - a: { value: 'ኣ', next: null }, - A: { value: 'ኣ', next: null }, - o: { value: 'ኦ', next: { a: { value: 'ⶊ', next: null }, A: { value: 'ⶊ', next: null } } }, - O: { value: 'ኦ', next: { a: { value: 'ⶊ', next: null }, A: { value: 'ⶊ', next: null } } }, - }, - }, - k: { - value: 'ክ', - next: { - e: { value: 'ከ', next: null }, - E: { value: 'ከ', next: null }, - u: { - value: 'ኩ', - next: { - e: { value: 'ኰ', next: null }, - E: { value: 'ኰ', next: null }, - u: { value: 'ኵ', next: null }, - U: { value: 'ኵ', next: null }, - i: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - I: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - a: { value: 'ኳ', next: null }, - A: { value: 'ኳ', next: null }, - }, - }, - U: { - value: 'ኩ', - next: { - e: { value: 'ኰ', next: null }, - E: { value: 'ኰ', next: null }, - u: { value: 'ኵ', next: null }, - U: { value: 'ኵ', next: null }, - i: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - I: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - a: { value: 'ኳ', next: null }, - A: { value: 'ኳ', next: null }, - }, - }, - i: { value: 'ኪ', next: { e: { value: 'ኬ', next: null }, E: { value: 'ኬ', next: null } } }, - I: { value: 'ኪ', next: { e: { value: 'ኬ', next: null }, E: { value: 'ኬ', next: null } } }, - a: { value: 'ካ', next: null }, - A: { value: 'ካ', next: null }, - o: { value: 'ኮ', next: { a: { value: 'ኯ', next: null }, A: { value: 'ኯ', next: null } } }, - O: { value: 'ኮ', next: { a: { value: 'ኯ', next: null }, A: { value: 'ኯ', next: null } } }, - Y: { - value: 'ⷍ', - next: { - e: { value: 'ⷈ', next: null }, - E: { value: 'ⷈ', next: null }, - u: { value: 'ⷉ', next: null }, - U: { value: 'ⷉ', next: null }, - i: { value: 'ⷊ', next: { e: { value: 'ⷌ', next: null }, E: { value: 'ⷌ', next: null } } }, - I: { value: 'ⷊ', next: { e: { value: 'ⷌ', next: null }, E: { value: 'ⷌ', next: null } } }, - a: { value: 'ⷋ', next: null }, - A: { value: 'ⷋ', next: null }, - o: { value: 'ⷎ', next: null }, - O: { value: 'ⷎ', next: null }, - }, - }, - }, - }, - K: { - value: 'ክ', - next: { - e: { value: 'ከ', next: null }, - E: { value: 'ከ', next: null }, - u: { - value: 'ኩ', - next: { - e: { value: 'ኰ', next: null }, - E: { value: 'ኰ', next: null }, - u: { value: 'ኵ', next: null }, - U: { value: 'ኵ', next: null }, - i: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - I: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - a: { value: 'ኳ', next: null }, - A: { value: 'ኳ', next: null }, - }, - }, - U: { - value: 'ኩ', - next: { - e: { value: 'ኰ', next: null }, - E: { value: 'ኰ', next: null }, - u: { value: 'ኵ', next: null }, - U: { value: 'ኵ', next: null }, - i: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - I: { value: 'ኲ', next: { e: { value: 'ኴ', next: null }, E: { value: 'ኴ', next: null } } }, - a: { value: 'ኳ', next: null }, - A: { value: 'ኳ', next: null }, - }, - }, - i: { value: 'ኪ', next: { e: { value: 'ኬ', next: null }, E: { value: 'ኬ', next: null } } }, - I: { value: 'ኪ', next: { e: { value: 'ኬ', next: null }, E: { value: 'ኬ', next: null } } }, - a: { value: 'ካ', next: null }, - A: { value: 'ካ', next: null }, - o: { value: 'ኮ', next: { a: { value: 'ኯ', next: null }, A: { value: 'ኯ', next: null } } }, - O: { value: 'ኮ', next: { a: { value: 'ኯ', next: null }, A: { value: 'ኯ', next: null } } }, - Y: { - value: 'ⷕ', - next: { - e: { value: 'ⷐ', next: null }, - E: { value: 'ⷐ', next: null }, - u: { value: 'ⷑ', next: null }, - U: { value: 'ⷑ', next: null }, - i: { value: 'ⷒ', next: { e: { value: 'ⷔ', next: null }, E: { value: 'ⷔ', next: null } } }, - I: { value: 'ⷒ', next: { e: { value: 'ⷔ', next: null }, E: { value: 'ⷔ', next: null } } }, - a: { value: 'ⷓ', next: null }, - A: { value: 'ⷓ', next: null }, - o: { value: 'ⷖ', next: null }, - O: { value: 'ⷖ', next: null }, - }, - }, - }, - }, - w: { - value: 'ው', - next: { - e: { value: 'ወ', next: null }, - E: { value: 'ወ', next: null }, - u: { value: 'ዉ', next: null }, - U: { value: 'ዉ', next: null }, - i: { value: 'ዊ', next: { e: { value: 'ዌ', next: null }, E: { value: 'ዌ', next: null } } }, - I: { value: 'ዊ', next: { e: { value: 'ዌ', next: null }, E: { value: 'ዌ', next: null } } }, - a: { value: 'ዋ', next: null }, - A: { value: 'ዋ', next: null }, - o: { value: 'ዎ', next: { a: { value: 'ዏ', next: null }, A: { value: 'ዏ', next: null } } }, - O: { value: 'ዎ', next: { a: { value: 'ዏ', next: null }, A: { value: 'ዏ', next: null } } }, - }, - }, - W: { - value: 'ው', - next: { - e: { value: 'ወ', next: null }, - E: { value: 'ወ', next: null }, - u: { value: 'ዉ', next: null }, - U: { value: 'ዉ', next: null }, - i: { value: 'ዊ', next: { e: { value: 'ዌ', next: null }, E: { value: 'ዌ', next: null } } }, - I: { value: 'ዊ', next: { e: { value: 'ዌ', next: null }, E: { value: 'ዌ', next: null } } }, - a: { value: 'ዋ', next: null }, - A: { value: 'ዋ', next: null }, - o: { value: 'ዎ', next: { a: { value: 'ዏ', next: null }, A: { value: 'ዏ', next: null } } }, - O: { value: 'ዎ', next: { a: { value: 'ዏ', next: null }, A: { value: 'ዏ', next: null } } }, - }, - }, - A: { - value: 'ዐ', - next: { - e: { value: 'ዕ', next: null }, - E: { value: 'ዕ', next: null }, - u: { value: 'ዑ', next: null }, - U: { value: 'ዑ', next: null }, - i: { value: 'ዒ', next: { e: { value: 'ዔ', next: null }, E: { value: 'ዔ', next: null } } }, - I: { value: 'ዒ', next: { e: { value: 'ዔ', next: null }, E: { value: 'ዔ', next: null } } }, - a: { value: 'ዓ', next: null }, - A: { value: 'ዓ', next: null }, - o: { value: 'ዖ', next: null }, - O: { value: 'ዖ', next: null }, - }, - }, - z: { - value: 'ዝ', - next: { - e: { value: 'ዘ', next: null }, - E: { value: 'ዘ', next: null }, - u: { value: 'ዙ', next: { a: { value: 'ዟ', next: null }, A: { value: 'ዟ', next: null } } }, - U: { value: 'ዙ', next: { a: { value: 'ዟ', next: null }, A: { value: 'ዟ', next: null } } }, - i: { value: 'ዚ', next: { e: { value: 'ዜ', next: null }, E: { value: 'ዜ', next: null } } }, - I: { value: 'ዚ', next: { e: { value: 'ዜ', next: null }, E: { value: 'ዜ', next: null } } }, - a: { value: 'ዛ', next: null }, - A: { value: 'ዛ', next: null }, - o: { value: 'ዞ', next: { a: { value: 'ⶋ', next: null }, A: { value: 'ⶋ', next: null } } }, - O: { value: 'ዞ', next: { a: { value: 'ⶋ', next: null }, A: { value: 'ⶋ', next: null } } }, - }, - }, - Z: { - value: 'ዥ', - next: { - e: { value: 'ዠ', next: null }, - E: { value: 'ዠ', next: null }, - u: { value: 'ዡ', next: { a: { value: 'ዧ', next: null }, A: { value: 'ዧ', next: null } } }, - U: { value: 'ዡ', next: { a: { value: 'ዧ', next: null }, A: { value: 'ዧ', next: null } } }, - i: { value: 'ዢ', next: { e: { value: 'ዤ', next: null }, E: { value: 'ዤ', next: null } } }, - I: { value: 'ዢ', next: { e: { value: 'ዤ', next: null }, E: { value: 'ዤ', next: null } } }, - a: { value: 'ዣ', next: null }, - A: { value: 'ዣ', next: null }, - o: { value: 'ዦ', next: null }, - O: { value: 'ዦ', next: null }, - Z: { - value: 'ⶵ', - next: { - e: { value: 'ⶰ', next: null }, - E: { value: 'ⶰ', next: null }, - u: { value: 'ⶱ', next: null }, - U: { value: 'ⶱ', next: null }, - i: { value: 'ⶲ', next: { e: { value: 'ⶴ', next: null }, E: { value: 'ⶴ', next: null } } }, - I: { value: 'ⶲ', next: { e: { value: 'ⶴ', next: null }, E: { value: 'ⶴ', next: null } } }, - a: { value: 'ⶳ', next: null }, - A: { value: 'ⶳ', next: null }, - o: { value: 'ⶶ', next: null }, - O: { value: 'ⶶ', next: null }, - }, - }, - }, - }, - y: { - value: 'ይ', - next: { - e: { value: 'የ', next: null }, - E: { value: 'የ', next: null }, - u: { value: 'ዩ', next: null }, - U: { value: 'ዩ', next: null }, - i: { value: 'ዪ', next: { e: { value: 'ዬ', next: null }, E: { value: 'ዬ', next: null } } }, - I: { value: 'ዪ', next: { e: { value: 'ዬ', next: null }, E: { value: 'ዬ', next: null } } }, - a: { value: 'ያ', next: null }, - A: { value: 'ያ', next: null }, - o: { value: 'ዮ', next: { a: { value: 'ዯ', next: null }, A: { value: 'ዯ', next: null } } }, - O: { value: 'ዮ', next: { a: { value: 'ዯ', next: null }, A: { value: 'ዯ', next: null } } }, - }, - }, - Y: { - value: 'ይ', - next: { - e: { value: 'የ', next: null }, - E: { value: 'የ', next: null }, - u: { value: 'ዩ', next: null }, - U: { value: 'ዩ', next: null }, - i: { value: 'ዪ', next: { e: { value: 'ዬ', next: null }, E: { value: 'ዬ', next: null } } }, - I: { value: 'ዪ', next: { e: { value: 'ዬ', next: null }, E: { value: 'ዬ', next: null } } }, - a: { value: 'ያ', next: null }, - A: { value: 'ያ', next: null }, - o: { value: 'ዮ', next: { a: { value: 'ዯ', next: null }, A: { value: 'ዯ', next: null } } }, - O: { value: 'ዮ', next: { a: { value: 'ዯ', next: null }, A: { value: 'ዯ', next: null } } }, - }, - }, - d: { - value: 'ድ', - next: { - e: { value: 'ደ', next: null }, - E: { value: 'ደ', next: null }, - u: { value: 'ዱ', next: { a: { value: 'ዷ', next: null }, A: { value: 'ዷ', next: null } } }, - U: { value: 'ዱ', next: { a: { value: 'ዷ', next: null }, A: { value: 'ዷ', next: null } } }, - i: { value: 'ዲ', next: { e: { value: 'ዴ', next: null }, E: { value: 'ዴ', next: null } } }, - I: { value: 'ዲ', next: { e: { value: 'ዴ', next: null }, E: { value: 'ዴ', next: null } } }, - a: { value: 'ዳ', next: null }, - A: { value: 'ዳ', next: null }, - o: { value: 'ዶ', next: { a: { value: 'ⶌ', next: null }, A: { value: 'ⶌ', next: null } } }, - O: { value: 'ዶ', next: { a: { value: 'ⶌ', next: null }, A: { value: 'ⶌ', next: null } } }, - }, - }, - D: { - value: 'ዽ', - next: { - e: { value: 'ዸ', next: null }, - E: { value: 'ዸ', next: null }, - u: { value: 'ዹ', next: { a: { value: 'ዿ', next: null }, A: { value: 'ዿ', next: null } } }, - U: { value: 'ዹ', next: { a: { value: 'ዿ', next: null }, A: { value: 'ዿ', next: null } } }, - i: { value: 'ዺ', next: { e: { value: 'ዼ', next: null }, E: { value: 'ዼ', next: null } } }, - I: { value: 'ዺ', next: { e: { value: 'ዼ', next: null }, E: { value: 'ዼ', next: null } } }, - a: { value: 'ዻ', next: null }, - A: { value: 'ዻ', next: null }, - o: { value: 'ዾ', next: { a: { value: 'ⶍ', next: null }, A: { value: 'ⶍ', next: null } } }, - O: { value: 'ዾ', next: { a: { value: 'ⶍ', next: null }, A: { value: 'ⶍ', next: null } } }, - }, - }, - j: { - value: 'ጅ', - next: { - e: { value: 'ጀ', next: null }, - E: { value: 'ጀ', next: null }, - u: { value: 'ጁ', next: { a: { value: 'ጇ', next: null }, A: { value: 'ጇ', next: null } } }, - U: { value: 'ጁ', next: { a: { value: 'ጇ', next: null }, A: { value: 'ጇ', next: null } } }, - i: { value: 'ጂ', next: { e: { value: 'ጄ', next: null }, E: { value: 'ጄ', next: null } } }, - I: { value: 'ጂ', next: { e: { value: 'ጄ', next: null }, E: { value: 'ጄ', next: null } } }, - a: { value: 'ጃ', next: null }, - A: { value: 'ጃ', next: null }, - o: { value: 'ጆ', next: { a: { value: 'ⶎ', next: null }, A: { value: 'ⶎ', next: null } } }, - O: { value: 'ጆ', next: { a: { value: 'ⶎ', next: null }, A: { value: 'ⶎ', next: null } } }, - }, - }, - J: { - value: 'ጅ', - next: { - e: { value: 'ጀ', next: null }, - E: { value: 'ጀ', next: null }, - u: { value: 'ጁ', next: { a: { value: 'ጇ', next: null }, A: { value: 'ጇ', next: null } } }, - U: { value: 'ጁ', next: { a: { value: 'ጇ', next: null }, A: { value: 'ጇ', next: null } } }, - i: { value: 'ጂ', next: { e: { value: 'ጄ', next: null }, E: { value: 'ጄ', next: null } } }, - I: { value: 'ጂ', next: { e: { value: 'ጄ', next: null }, E: { value: 'ጄ', next: null } } }, - a: { value: 'ጃ', next: null }, - A: { value: 'ጃ', next: null }, - o: { value: 'ጆ', next: { a: { value: 'ⶎ', next: null }, A: { value: 'ⶎ', next: null } } }, - O: { value: 'ጆ', next: { a: { value: 'ⶎ', next: null }, A: { value: 'ⶎ', next: null } } }, - }, - }, - g: { - value: 'ግ', - next: { - e: { value: 'ገ', next: null }, - E: { value: 'ገ', next: null }, - u: { - value: 'ጉ', - next: { - e: { value: 'ጐ', next: null }, - E: { value: 'ጐ', next: null }, - u: { value: 'ጕ', next: null }, - U: { value: 'ጕ', next: null }, - i: { value: 'ጒ', next: { e: { value: 'ጔ', next: null }, E: { value: 'ጔ', next: null } } }, - I: { value: 'ጒ', next: { e: { value: 'ጔ', next: null }, E: { value: 'ጔ', next: null } } }, - a: { value: 'ጓ', next: null }, - A: { value: 'ጓ', next: null }, - }, - }, - U: { - value: 'ጉ', - next: { - e: { value: 'ጐ', next: null }, - E: { value: 'ጐ', next: null }, - u: { value: 'ጕ', next: null }, - U: { value: 'ጕ', next: null }, - i: { value: 'ጒ', next: { e: { value: 'ጔ', next: null }, E: { value: 'ጔ', next: null } } }, - I: { value: 'ጒ', next: { e: { value: 'ጔ', next: null }, E: { value: 'ጔ', next: null } } }, - a: { value: 'ጓ', next: null }, - A: { value: 'ጓ', next: null }, - }, - }, - i: { value: 'ጊ', next: { e: { value: 'ጌ', next: null }, E: { value: 'ጌ', next: null } } }, - I: { value: 'ጊ', next: { e: { value: 'ጌ', next: null }, E: { value: 'ጌ', next: null } } }, - a: { value: 'ጋ', next: null }, - A: { value: 'ጋ', next: null }, - o: { value: 'ጎ', next: { a: { value: 'ጏ', next: null }, A: { value: 'ጏ', next: null } } }, - O: { value: 'ጎ', next: { a: { value: 'ጏ', next: null }, A: { value: 'ጏ', next: null } } }, - Y: { - value: 'ⷝ', - next: { - e: { value: 'ⷘ', next: null }, - E: { value: 'ⷘ', next: null }, - u: { value: 'ⷙ', next: null }, - U: { value: 'ⷙ', next: null }, - i: { value: 'ⷚ', next: { e: { value: 'ⷜ', next: null }, E: { value: 'ⷜ', next: null } } }, - I: { value: 'ⷚ', next: { e: { value: 'ⷜ', next: null }, E: { value: 'ⷜ', next: null } } }, - a: { value: 'ⷛ', next: null }, - A: { value: 'ⷛ', next: null }, - o: { value: 'ⷞ', next: null }, - O: { value: 'ⷞ', next: null }, - }, - }, - }, - }, - G: { - value: 'ጝ', - next: { - e: { value: 'ጘ', next: null }, - E: { value: 'ጘ', next: null }, - u: { - value: 'ጙ', - next: { - e: { value: 'ⶓ', next: null }, - E: { value: 'ⶓ', next: null }, - u: { value: 'ⶖ', next: null }, - U: { value: 'ⶖ', next: null }, - i: { value: 'ⶔ', next: { e: { value: 'ⶕ', next: null }, E: { value: 'ⶕ', next: null } } }, - I: { value: 'ⶔ', next: { e: { value: 'ⶕ', next: null }, E: { value: 'ⶕ', next: null } } }, - a: { value: 'ጟ', next: null }, - A: { value: 'ጟ', next: null }, - }, - }, - U: { - value: 'ጙ', - next: { - e: { value: 'ⶓ', next: null }, - E: { value: 'ⶓ', next: null }, - u: { value: 'ⶖ', next: null }, - U: { value: 'ⶖ', next: null }, - i: { value: 'ⶔ', next: { e: { value: 'ⶕ', next: null }, E: { value: 'ⶕ', next: null } } }, - I: { value: 'ⶔ', next: { e: { value: 'ⶕ', next: null }, E: { value: 'ⶕ', next: null } } }, - a: { value: 'ጟ', next: null }, - A: { value: 'ጟ', next: null }, - }, - }, - i: { value: 'ጚ', next: { e: { value: 'ጜ', next: null }, E: { value: 'ጜ', next: null } } }, - I: { value: 'ጚ', next: { e: { value: 'ጜ', next: null }, E: { value: 'ጜ', next: null } } }, - a: { value: 'ጛ', next: null }, - A: { value: 'ጛ', next: null }, - o: { value: 'ጞ', next: null }, - O: { value: 'ጞ', next: null }, - }, - }, - T: { - value: 'ጥ', - next: { - e: { value: 'ጠ', next: null }, - E: { value: 'ጠ', next: null }, - u: { value: 'ጡ', next: { a: { value: 'ጧ', next: null }, A: { value: 'ጧ', next: null } } }, - U: { value: 'ጡ', next: { a: { value: 'ጧ', next: null }, A: { value: 'ጧ', next: null } } }, - i: { value: 'ጢ', next: { e: { value: 'ጤ', next: null }, E: { value: 'ጤ', next: null } } }, - I: { value: 'ጢ', next: { e: { value: 'ጤ', next: null }, E: { value: 'ጤ', next: null } } }, - a: { value: 'ጣ', next: null }, - A: { value: 'ጣ', next: null }, - o: { value: 'ጦ', next: { a: { value: 'ⶏ', next: null }, A: { value: 'ⶏ', next: null } } }, - O: { value: 'ጦ', next: { a: { value: 'ⶏ', next: null }, A: { value: 'ⶏ', next: null } } }, - }, - }, - C: { - value: 'ጭ', - next: { - e: { value: 'ጨ', next: null }, - E: { value: 'ጨ', next: null }, - u: { value: 'ጩ', next: { a: { value: 'ጯ', next: null }, A: { value: 'ጯ', next: null } } }, - U: { value: 'ጩ', next: { a: { value: 'ጯ', next: null }, A: { value: 'ጯ', next: null } } }, - i: { value: 'ጪ', next: { e: { value: 'ጬ', next: null }, E: { value: 'ጬ', next: null } } }, - I: { value: 'ጪ', next: { e: { value: 'ጬ', next: null }, E: { value: 'ጬ', next: null } } }, - a: { value: 'ጫ', next: null }, - A: { value: 'ጫ', next: null }, - o: { value: 'ጮ', next: { a: { value: 'ⶐ', next: null }, A: { value: 'ⶐ', next: null } } }, - O: { value: 'ጮ', next: { a: { value: 'ⶐ', next: null }, A: { value: 'ⶐ', next: null } } }, - C: { - value: 'ⶽ', - next: { - e: { value: 'ⶸ', next: null }, - E: { value: 'ⶸ', next: null }, - u: { value: 'ⶹ', next: null }, - U: { value: 'ⶹ', next: null }, - i: { value: 'ⶺ', next: { e: { value: 'ⶼ', next: null }, E: { value: 'ⶼ', next: null } } }, - I: { value: 'ⶺ', next: { e: { value: 'ⶼ', next: null }, E: { value: 'ⶼ', next: null } } }, - a: { value: 'ⶻ', next: null }, - A: { value: 'ⶻ', next: null }, - o: { value: 'ⶾ', next: null }, - O: { value: 'ⶾ', next: null }, - }, - }, - }, - }, - P: { - value: 'ጵ', - next: { - e: { value: 'ጰ', next: null }, - E: { value: 'ጰ', next: null }, - u: { value: 'ጱ', next: { a: { value: 'ጷ', next: null }, A: { value: 'ጷ', next: null } } }, - U: { value: 'ጱ', next: { a: { value: 'ጷ', next: null }, A: { value: 'ጷ', next: null } } }, - i: { value: 'ጲ', next: { e: { value: 'ጴ', next: null }, E: { value: 'ጴ', next: null } } }, - I: { value: 'ጲ', next: { e: { value: 'ጴ', next: null }, E: { value: 'ጴ', next: null } } }, - a: { value: 'ጳ', next: null }, - A: { value: 'ጳ', next: null }, - o: { value: 'ጶ', next: { a: { value: 'ⶑ', next: null }, A: { value: 'ⶑ', next: null } } }, - O: { value: 'ጶ', next: { a: { value: 'ⶑ', next: null }, A: { value: 'ⶑ', next: null } } }, - }, - }, - S: { - value: 'ጽ', - next: { - e: { value: 'ጸ', next: null }, - E: { value: 'ጸ', next: null }, - u: { value: 'ጹ', next: { a: { value: 'ጿ', next: null }, A: { value: 'ጿ', next: null } } }, - U: { value: 'ጹ', next: { a: { value: 'ጿ', next: null }, A: { value: 'ጿ', next: null } } }, - i: { value: 'ጺ', next: { e: { value: 'ጼ', next: null }, E: { value: 'ጼ', next: null } } }, - I: { value: 'ጺ', next: { e: { value: 'ጼ', next: null }, E: { value: 'ጼ', next: null } } }, - a: { value: 'ጻ', next: null }, - A: { value: 'ጻ', next: null }, - o: { value: 'ጾ', next: null }, - O: { value: 'ጾ', next: null }, - S: { - value: 'ፅ', - next: { - e: { value: 'ፀ', next: null }, - E: { value: 'ፀ', next: null }, - u: { value: 'ፁ', next: null }, - U: { value: 'ፁ', next: null }, - i: { value: 'ፂ', next: { e: { value: 'ፄ', next: null }, E: { value: 'ፄ', next: null } } }, - I: { value: 'ፂ', next: { e: { value: 'ፄ', next: null }, E: { value: 'ፄ', next: null } } }, - a: { value: 'ፃ', next: null }, - A: { value: 'ፃ', next: null }, - o: { value: 'ፆ', next: { a: { value: 'ፇ', next: null }, A: { value: 'ፇ', next: null } } }, - O: { value: 'ፆ', next: { a: { value: 'ፇ', next: null }, A: { value: 'ፇ', next: null } } }, - }, - }, - }, - }, - f: { - value: 'ፍ', - next: { - e: { value: 'ፈ', next: null }, - E: { value: 'ፈ', next: null }, - u: { - value: 'ፉ', - next: { - e: { value: 'ᎈ', next: null }, - E: { value: 'ᎈ', next: null }, - u: { value: 'ᎉ', next: null }, - U: { value: 'ᎉ', next: null }, - i: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - I: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - a: { value: 'ፏ', next: null }, - A: { value: 'ፏ', next: null }, - }, - }, - U: { - value: 'ፉ', - next: { - e: { value: 'ᎈ', next: null }, - E: { value: 'ᎈ', next: null }, - u: { value: 'ᎉ', next: null }, - U: { value: 'ᎉ', next: null }, - i: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - I: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - a: { value: 'ፏ', next: null }, - A: { value: 'ፏ', next: null }, - }, - }, - i: { value: 'ፊ', next: { e: { value: 'ፌ', next: null }, E: { value: 'ፌ', next: null } } }, - I: { value: 'ፊ', next: { e: { value: 'ፌ', next: null }, E: { value: 'ፌ', next: null } } }, - a: { value: 'ፋ', next: null }, - A: { value: 'ፋ', next: null }, - o: { value: 'ፎ', next: null }, - O: { value: 'ፎ', next: null }, - Y: { value: 'ፚ', next: null }, - }, - }, - F: { - value: 'ፍ', - next: { - e: { value: 'ፈ', next: null }, - E: { value: 'ፈ', next: null }, - u: { - value: 'ፉ', - next: { - e: { value: 'ᎈ', next: null }, - E: { value: 'ᎈ', next: null }, - u: { value: 'ᎉ', next: null }, - U: { value: 'ᎉ', next: null }, - i: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - I: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - a: { value: 'ፏ', next: null }, - A: { value: 'ፏ', next: null }, - }, - }, - U: { - value: 'ፉ', - next: { - e: { value: 'ᎈ', next: null }, - E: { value: 'ᎈ', next: null }, - u: { value: 'ᎉ', next: null }, - U: { value: 'ᎉ', next: null }, - i: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - I: { value: 'ᎋ', next: { e: { value: 'ᎊ', next: null }, E: { value: 'ᎊ', next: null } } }, - a: { value: 'ፏ', next: null }, - A: { value: 'ፏ', next: null }, - }, - }, - i: { value: 'ፊ', next: { e: { value: 'ፌ', next: null }, E: { value: 'ፌ', next: null } } }, - I: { value: 'ፊ', next: { e: { value: 'ፌ', next: null }, E: { value: 'ፌ', next: null } } }, - a: { value: 'ፋ', next: null }, - A: { value: 'ፋ', next: null }, - o: { value: 'ፎ', next: null }, - O: { value: 'ፎ', next: null }, - Y: { value: 'ፚ', next: null }, - }, - }, - p: { - value: 'ፕ', - next: { - e: { value: 'ፐ', next: null }, - E: { value: 'ፐ', next: null }, - u: { - value: 'ፑ', - next: { - e: { value: 'ᎌ', next: null }, - E: { value: 'ᎌ', next: null }, - u: { value: 'ᎍ', next: null }, - U: { value: 'ᎍ', next: null }, - i: { value: 'ᎏ', next: { e: { value: 'ᎎ', next: null }, E: { value: 'ᎎ', next: null } } }, - I: { value: 'ᎏ', next: { e: { value: 'ᎎ', next: null }, E: { value: 'ᎎ', next: null } } }, - a: { value: 'ፗ', next: null }, - A: { value: 'ፗ', next: null }, - }, - }, - U: { - value: 'ፑ', - next: { - e: { value: 'ᎌ', next: null }, - E: { value: 'ᎌ', next: null }, - u: { value: 'ᎍ', next: null }, - U: { value: 'ᎍ', next: null }, - i: { value: 'ᎏ', next: { e: { value: 'ᎎ', next: null }, E: { value: 'ᎎ', next: null } } }, - I: { value: 'ᎏ', next: { e: { value: 'ᎎ', next: null }, E: { value: 'ᎎ', next: null } } }, - a: { value: 'ፗ', next: null }, - A: { value: 'ፗ', next: null }, - }, - }, - i: { value: 'ፒ', next: { e: { value: 'ፔ', next: null }, E: { value: 'ፔ', next: null } } }, - I: { value: 'ፒ', next: { e: { value: 'ፔ', next: null }, E: { value: 'ፔ', next: null } } }, - a: { value: 'ፓ', next: null }, - A: { value: 'ፓ', next: null }, - o: { value: 'ፖ', next: { a: { value: 'ⶒ', next: null }, A: { value: 'ⶒ', next: null } } }, - O: { value: 'ፖ', next: { a: { value: 'ⶒ', next: null }, A: { value: 'ⶒ', next: null } } }, - }, - }, - e: { value: 'እ', next: null }, - i: { value: 'ኢ', next: { e: { value: 'ኤ', next: null }, E: { value: 'ኤ', next: null } } }, - o: { value: 'ኦ', next: null }, - u: { value: 'ኡ', next: null }, - E: { value: 'ዕ', next: null }, - I: { value: 'ዒ', next: { e: { value: 'ዔ', next: null }, E: { value: 'ዔ', next: null } } }, - O: { value: 'ዖ', next: null }, - U: { value: 'ዑ', next: null }, - ':': { - value: '፡', - next: { ':': { value: '።', next: { ':': { value: ':', next: null } } }, ',': { value: '፥', next: null } }, - }, - ',': { value: '፣', next: { ',': { value: '፥', next: { ',': { value: ',', next: null } } } } }, - ';': { value: '፤', next: { ';': { value: ';', next: null } } }, - '<': { value: '‹', next: { '<': { value: '«', next: { '<': { value: '<', next: null } } } } }, - '>': { value: '›', next: { '>': { value: '»', next: { '>': { value: '>', next: null } } } } }, - }, -}; -export default layout; diff --git a/packages/web/src/KeywriteWeb.ts b/packages/web/src/KeywriteWeb.ts index b75df2a..12bccba 100644 --- a/packages/web/src/KeywriteWeb.ts +++ b/packages/web/src/KeywriteWeb.ts @@ -1,12 +1,11 @@ -import { Keywrite, KeyboardLayout } from '@keywrite/core'; - +import Keywrite, { InputMethod } from '@keywrite/core'; export type Input = HTMLInputElement | HTMLTextAreaElement; -export class KeywriteWeb extends Keywrite { +export default class KeywriteWeb extends Keywrite { public on: boolean; private input: Input; - constructor(input: Input, layouts: Record, on = true) { - super(layouts); + constructor(input: Input, inputMethods: Record, on = true) { + super(inputMethods); this.on = on; this.input = input; @@ -73,7 +72,7 @@ export class KeywriteWeb extends Keywrite { } private setNativeValue(element: Input, value: string): void { const prototype = Object.getPrototypeOf(element); - const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value')?.set; - prototypeValueSetter?.call(element, value); + const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value')!.set; + prototypeValueSetter!.call(element, value); } } diff --git a/packages/web/src/index.ts b/packages/web/src/index.ts index bbfb9fa..6e68529 100644 --- a/packages/web/src/index.ts +++ b/packages/web/src/index.ts @@ -1 +1,2 @@ export * from './KeywriteWeb'; +export { default } from './KeywriteWeb'; diff --git a/packages/web/tests/KeywriteWeb.spec.ts b/packages/web/tests/KeywriteWeb.spec.ts index 6741010..7b6ec59 100644 --- a/packages/web/tests/KeywriteWeb.spec.ts +++ b/packages/web/tests/KeywriteWeb.spec.ts @@ -1,13 +1,13 @@ /** * @jest-environment jsdom */ -import { KeywriteWeb } from '../src'; -import Layout from './layout'; +import KeywriteWeb from '../src'; +import InputMethod from './input-method'; import { simulateTyping, simulateFocusout } from './utils'; describe('KeywriteWeb.ts', () => { let input: any = null; let textarea: any = null; - const KeyboardLayouts = { layout1: Layout }; + const InputMethods = { inputMethod1: InputMethod }; beforeEach(() => { document.body.innerHTML = ` @@ -18,14 +18,14 @@ describe('KeywriteWeb.ts', () => { textarea = document.querySelector('textarea') as HTMLTextAreaElement; }); it('should work with HTMLInputElement & HTMLTextAreaElement', () => { - const newInstance1 = new KeywriteWeb(input, KeyboardLayouts); - const newInstance2 = new KeywriteWeb(textarea, KeyboardLayouts); + const newInstance1 = new KeywriteWeb(input, InputMethods); + const newInstance2 = new KeywriteWeb(textarea, InputMethods); expect(newInstance1).toBeDefined(); expect(newInstance2).toBeDefined(); }); it('should be able to turn on after initialization', () => { - const inputInstance = new KeywriteWeb(input, KeyboardLayouts, false); - const textareaInstance = new KeywriteWeb(textarea, KeyboardLayouts, false); + const inputInstance = new KeywriteWeb(input, InputMethods, false); + const textareaInstance = new KeywriteWeb(textarea, InputMethods, false); const text = 'selam selam'; const expectedText = 'ሰላም ሰላም'; // input @@ -40,8 +40,8 @@ describe('KeywriteWeb.ts', () => { expect(input.value).toEqual(expectedText); }); it('should be able to turn off after initialization', () => { - const inputInstance = new KeywriteWeb(input, KeyboardLayouts, true); - const textareaInstance = new KeywriteWeb(textarea, KeyboardLayouts, true); + const inputInstance = new KeywriteWeb(input, InputMethods, true); + const textareaInstance = new KeywriteWeb(textarea, InputMethods, true); const text = 'selam'; const expectedText = 'selam'; // input @@ -58,8 +58,8 @@ describe('KeywriteWeb.ts', () => { expect(input.value).toEqual(expectedText); }); it('should not write character if (CTRL) key had been triggered ', () => { - new KeywriteWeb(input, KeyboardLayouts, true); - new KeywriteWeb(textarea, KeyboardLayouts, true); + new KeywriteWeb(input, InputMethods, true); + new KeywriteWeb(textarea, InputMethods, true); const text = ['s', 'e', 'l', 'Control', 'a', 'm']; const expectedText = 'ሰልም'; @@ -72,8 +72,8 @@ describe('KeywriteWeb.ts', () => { }); it('should not write character if (ALT) key had been triggered ', () => { - new KeywriteWeb(input, KeyboardLayouts, true); - new KeywriteWeb(textarea, KeyboardLayouts, true); + new KeywriteWeb(input, InputMethods, true); + new KeywriteWeb(textarea, InputMethods, true); const text = ['s', 'e', 'l', 'Alt', 'a', 'm']; const expectedText = 'ሰልም'; @@ -86,8 +86,8 @@ describe('KeywriteWeb.ts', () => { }); it('should not write character if (META) key had been triggered ', () => { - new KeywriteWeb(input, KeyboardLayouts, true); - new KeywriteWeb(textarea, KeyboardLayouts, true); + new KeywriteWeb(input, InputMethods, true); + new KeywriteWeb(textarea, InputMethods, true); const text = ['s', 'e', 'l', 'Meta', 'a', 'm']; const expectedText = 'ሰልም'; @@ -100,8 +100,8 @@ describe('KeywriteWeb.ts', () => { }); it('should reset scope if input looses focus', () => { - new KeywriteWeb(input, KeyboardLayouts, true); - new KeywriteWeb(textarea, KeyboardLayouts, true); + new KeywriteWeb(input, InputMethods, true); + new KeywriteWeb(textarea, InputMethods, true); const texts = [ ['s', 'e', 'l'], ['a', 'm'], diff --git a/packages/web/tests/layout.ts b/packages/web/tests/input-method.ts similarity index 100% rename from packages/web/tests/layout.ts rename to packages/web/tests/input-method.ts diff --git a/tsconfig.json b/tsconfig.json index 9c6b3c1..ba89a0f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,8 @@ "paths": { "@keywrite/core/*": ["core/src/*"], "@keywrite/web/*": ["web/src/*"], - "@keywrite/ethiopic-layouts/*": ["ethiopic-layouts/src/*"], - "@keywrite/layout-generator/*": ["layout-generator/src/*"] + "@keywrite/input-method-generator/*": ["input-method-generator/src/*"], + "@keywrite/ethiopic-input-methods/*": ["ethiopic-input-methods/src/*"] } }, "files": [], @@ -15,10 +15,10 @@ "path": "packages/core" }, { - "path": "packages/ethiopic-layouts" + "path": "packages/ethiopic_input_methods" }, { - "path": "packages/layout-generator" + "path": "packages/input-method-generator" }, { "path": "packages/web"