# attajak/latinime architecture

> Architecture diagram of the GitHub repository attajak/latinime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/attajak/latinime
- Repository: https://github.com/attajak/latinime

## Overview

This repository implements an Android Latin keyboard/input method, with related spell-checking and downloadable dictionary support. The principal workflow is a user entering text through the keyboard, which is processed by input logic and can use dictionary-based suggestions before text is committed to the editor. The tree also shows gesture input, emoji, settings, personalization, and setup capabilities. The excerpts and index establish some subsystem references, but do not expose the main input-view dispatch path; those workflow links are therefore dashed and unverified.

Main entry points: [`java/src/com/android/inputmethod/latin/LatinIME.java`](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/LatinIME.java) (Latin IME), [`java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java`](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java) (Dictionary manager), [`java/src/com/android/inputmethod/keyboard/KeyboardView.java`](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/KeyboardView.java) (Keyboard UI), [`java/src/com/android/inputmethod/dictionarypack/DictionaryService.java`](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java) (Dictionary downloads)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Keyboard input"]
  node_ime["Latin IME<br/>[LatinIME.java]"]
  node_keyboard["Keyboard UI<br/>[KeyboardView.java]"]
  node_layout["Keyboard layouts"]
  node_inputlogic["Input logic<br/>[InputLogic.java]"]
  node_gesture["Gesture input"]
  node_emoji["Emoji keyboard"]
end

subgraph group_language["Language services"]
  node_suggest["Suggestion engine<br/>[Suggest.java]"]
  node_suggestui["Suggestion strip"]
  node_spell["Spell checker"]
end

subgraph group_dictionary["Dictionary support"]
  node_dictionary["Dictionary manager"]
  node_binarydict["Binary dictionaries"]
  node_native["Native traversal"]
  node_dictdownload["Dictionary downloads"]
  node_metadata[("Dictionary metadata")]
  node_contacts["Contact words"]
  node_history["User history"]
end

subgraph group_platform["IME configuration"]
  node_subtypes["IME subtypes"]
  node_subtypeutils["Subtype storage"]
  node_settings["Settings<br/>[Settings.java]"]
end

subgraph group_experience["User features"]
  node_setup["Setup wizard"]
  node_accessibility["Accessibility"]
end

node_user(("Keyboard user"))
node_editor["Text editor"]

node_user -.->|"touches"| node_keyboard
node_keyboard -.->|"dispatches input"| node_ime
node_ime -.->|"processes input"| node_inputlogic
node_ime -.->|"commits text"| node_editor
node_ime -.->|"builds keyboard"| node_layout
node_ime -.->|"requests suggestions"| node_suggest
node_suggest -.->|"queries words"| node_dictionary
node_suggest -.->|"provides candidates"| node_suggestui
node_spell -->|"uses dictionaries"| node_dictionary
node_spell -->|"creates keyboard"| node_layout
node_native -.->|"traverses dictionary"| node_dictionary
node_dictdownload -->|"updates metadata"| node_metadata
node_dictdownload -->|"prepares downloads"| node_binarydict
node_dictdownload -.->|"serves IME clients"| node_user
node_subtypes -->|"loads subtype data"| node_subtypeutils
node_subtypes -->|"reads settings"| node_settings
node_contacts -.->|"supplies contact words"| node_dictionary
node_history -.->|"personalizes words"| node_dictionary
node_gesture -.->|"provides gesture input"| node_inputlogic
node_emoji -.->|"extends keyboard"| node_keyboard
node_accessibility -.->|"supports access"| node_keyboard
node_setup -.->|"configures preferences"| node_settings

click node_ime "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/LatinIME.java"
click node_keyboard "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/KeyboardView.java"
click node_layout "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java"
click node_inputlogic "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java"
click node_gesture "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java"
click node_emoji "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java"
click node_suggest "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/Suggest.java"
click node_suggestui "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java"
click node_spell "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java"
click node_dictionary "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java"
click node_binarydict "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/BinaryDictionary.java"
click node_native "https://github.com/attajak/latinime/blob/main/native/jni/src/suggest/core/session/dic_traverse_session.h"
click node_dictdownload "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java"
click node_metadata "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java"
click node_contacts "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/ContactsManager.java"
click node_history "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java"
click node_subtypes "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/RichInputMethodManager.java"
click node_subtypeutils "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java"
click node_settings "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/settings/Settings.java"
click node_setup "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java"
click node_accessibility "https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ime,node_keyboard,node_layout,node_inputlogic,node_gesture,node_emoji,node_user toneBlue
class node_suggest,node_suggestui,node_spell toneAmber
class node_dictionary,node_binarydict,node_native,node_dictdownload,node_metadata,node_contacts,node_history toneMint
class node_subtypes,node_subtypeutils,node_settings toneRose
class node_setup,node_accessibility,node_editor toneIndigo
```

## Components

### Keyboard input

- [Latin IME](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/LatinIME.java): `java/src/com/android/inputmethod/latin/LatinIME.java`
- [Keyboard UI](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/KeyboardView.java): `java/src/com/android/inputmethod/keyboard/KeyboardView.java`
- [Keyboard layouts](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java): `java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java`
- [Input logic](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java): `java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java`
- [Gesture input](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java): `java/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java`
- [Emoji keyboard](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java): `java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java`

### Language services

- [Suggestion engine](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/Suggest.java): `java/src/com/android/inputmethod/latin/Suggest.java`
- [Suggestion strip](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java): `java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java`
- [Spell checker](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java): `java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java`

### Dictionary support

- [Dictionary manager](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java): `java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java`
- [Binary dictionaries](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/BinaryDictionary.java): `java/src/com/android/inputmethod/latin/BinaryDictionary.java`
- [Native traversal](https://github.com/attajak/latinime/blob/main/native/jni/src/suggest/core/session/dic_traverse_session.h): `native/jni/src/suggest/core/session/dic_traverse_session.h`
- [Dictionary downloads](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java): `java/src/com/android/inputmethod/dictionarypack/DictionaryService.java`
- [Dictionary metadata](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java): `java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java`
- [Contact words](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/ContactsManager.java): `java/src/com/android/inputmethod/latin/ContactsManager.java`
- [User history](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java): `java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java`

### IME configuration

- [IME subtypes](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/RichInputMethodManager.java): `java/src/com/android/inputmethod/latin/RichInputMethodManager.java`
- [Subtype storage](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java): `java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java`
- [Settings](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/settings/Settings.java): `java/src/com/android/inputmethod/latin/settings/Settings.java`

### User features

- [Setup wizard](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java): `java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java`
- [Accessibility](https://github.com/attajak/latinime/blob/main/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java): `java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java`

### Other components

- **Keyboard user**
- **Text editor**

## Connections

- Keyboard user → Keyboard UI: touches
- Keyboard UI → Latin IME: dispatches input
- Latin IME → Input logic: processes input
- Latin IME → Text editor: commits text
- Latin IME → Keyboard layouts: builds keyboard
- Latin IME → Suggestion engine: requests suggestions
- Suggestion engine → Dictionary manager: queries words
- Suggestion engine → Suggestion strip: provides candidates
- Spell checker → Dictionary manager: uses dictionaries (evidence: `java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java`)
- Spell checker → Keyboard layouts: creates keyboard (evidence: `java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java`)
- Native traversal → Dictionary manager: traverses dictionary
- Dictionary downloads → Dictionary metadata: updates metadata (evidence: `java/src/com/android/inputmethod/dictionarypack/DictionaryService.java`)
- Dictionary downloads → Binary dictionaries: prepares downloads (evidence: `java/src/com/android/inputmethod/dictionarypack/DictionaryService.java`)
- Dictionary downloads → Keyboard user: serves IME clients
- IME subtypes → Subtype storage: loads subtype data (evidence: `java/src/com/android/inputmethod/latin/RichInputMethodManager.java`)
- IME subtypes → Settings: reads settings (evidence: `java/src/com/android/inputmethod/latin/RichInputMethodManager.java`)
- Contact words → Dictionary manager: supplies contact words
- User history → Dictionary manager: personalizes words
- Gesture input → Input logic: provides gesture input
- Emoji keyboard → Keyboard UI: extends keyboard
- Accessibility → Keyboard UI: supports access
- Setup wizard → Settings: configures preferences
