Making a Custom Dictionary

Fluent supports the use of custom dictionaries made by users. 

This page explains the technical details of how a custom dictionary is structured. This information is likely to be of interest to only programmers since it requires a higher level of technical experience.

Design Goals

Fluent Dictionary has the following design goals at it's core

In harmony with the goal of extensibility, this document outlines the information needed for a programmer to assemble a custom dictionary

Technical Overview

Fluent uses the SQLite database engine under the hood. All custom dictionaries are SQLite databases that conform o the following requirement:

Table Structures

This section defines the required tables needed in the custom dictionary, along with all field definitions.

SQLite schema structure for a custom dictionary:

CREATE TABLE DictionaryInformation (

   DictionaryID TEXT PRIMARY KEY, 

   Name TEXT NOT NULL, 

   Information TEXT NOT NULL

);


CREATE TABLE DictionaryItems (

   ItemID INTEGER PRIMARY KEY AUTOINCREMENT,

   DictionaryID TEXT NOT NULL,

   DisplayTerm TEXT NOT NULL,

   DisplayDefinition TEXT NOT NULL,

   SearchTerm TEXT NOT NULL,

   SortTerm TEXT NOT NULL

);


CREATE TABLE DictionaryResources (

   ItemID INTEGER PRIMARY KEY AUTOINCREMENT,

   DictionaryID TEXT NOT NULL, 

   Name TEXT NOT NULL, 

   URL TEXT NOT NULL

);

 

CREATE TABLE CharacterMapping (

   ItemID INTEGER PRIMARY KEY AUTOINCREMENT,

   DictionaryID TEXT NOT NULL, 

   OriginalCharacter TEXT NOT NULL, 

   MappedCharacter TEXT NOT NULL

);

TABLE: DictionaryInformation

Purpose: General information about your custom dictionary.

Table Fields:

TABLE: DictionaryItems

Purpose: Individual dictionary terms and their definitions. Each row represents a term in your dictionary. When the user searches, this is the table that contains all the entries. 

Table Fields:

Notes:

TABLE: DictionaryResources

Purpose: Each dictionary can provide a set of unique URLs for resources related to this dictionary. This allows the developer to linked terms found in a search in Fluent to additional resources online, such as Wikipedia, Forvo and so on.

Table Fields:

TABLE: CharacterMapping

Purpose: Each database can map a specific character from one to another character. These character maps are used to modify the search before running against SearchTerm. For example, imagine the letter č is used in the language of your custom dictionary, but in the SearchTerm field, you prefer the user uses c for a search since it can be easier to type on a mobile device. However if the user types č and this is not used in SearchTerm, it will not find a matching word. CharacterMapping helps fluent to convert these unique language characters to another character that is compatible with the SearchTerm.

The CharacterMapping table can be left empty if you don't want to use this feature.

Table Fields: