Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
cqb13 edited this page Apr 30, 2023 · 3 revisions

What is Open Words TS?

Open Words TS is a latin dictionary parser based off of Open Words. It provides a detailed analysis of latin words, including definitions, parts of speech, and inflectional forms.The dictionary contains over 39000 entries, as would be counted in an ordinary dictionary. This expands to almost twice that number of individual stems and, through additional word construction with hundreds of prefixes and suffixes, may generate more, leading to many hundreds of thousands of ‘words’ that can be formed by declension and conjugation. This version of WORDS provides a tool to help in translations for the Latin student.

How to use Open Words TS

Open Words TS is not a standalone application, but rather a library that can be used in other applications. To search for a word, you need to use the parseLine function from the parser class.

import { Parser } from './src/parser';

const parser = new Parser();

let output: any = parser.parseLine("Sunt geminae Somni portae", "lte", true);
let jsonOutput = JSON.stringify(output, null, 2);

console.log(jsonOutput);

Output:

[{'defs': [{'orth': ['sunt'], 'senses': ['to be, exist', 'also used to form verb perfect passive tenses with NOM PERF PPL'], 'infls': [{'form': {'form': 'PRES ACTIVE IND 3 P'}, 'ending': '', 'pos': 'verb'}]}], 'word': 'sunt'}, {'defs': [{'orth': ['gemin', 'gemin'], 'senses': ['twins (pl.)'], 'infls': [{'form': {'number': 'plural', 'declension': 'nominative', 'gender': 'neuter'}, 'ending': 'a', 'pos': 'noun'}, {'form': {'number': 'plural', 'declension': 'vocative', 'gender': 'neuter'}, 'ending': 'a', 'pos': 'noun'}, {'form': {'number': 'plural', 'declension': 'accusative', 'gender': 'neuter'}, 'ending': 'a', 'pos': 'noun'}, {'form': {'voice': 'active', 'person': 2, 'tense': 'present', 'mood': 'imperative', 'number': 'singular'}, 'ending': 'a', 'pos': 'verb'}]}], 'word': 'geminae'}, {'defs': [{'orth': ['somnius', 'somni'], 'senses': ['dream, vision', 'fantasy, day-dream'], 'infls': [{'form': {'number': 'singular', 'declension': 'nominative', 'gender': ''}, 'ending': '', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'vocative', 'gender': ''}, 'ending': '', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'genitive', 'gender': ''}, 'ending': '', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'vocative', 'gender': 'masculine'}, 'ending': '', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'genitive', 'gender': 'masculine'}, 'ending': '', 'pos': 'noun'}]}, {'orth': ['somnos', 'somni'], 'senses': ['sleep'], 'infls': [{'form': {'number': 'singular', 'declension': 'genitive', 'gender': ''}, 'ending': 'i', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'locative', 'gender': ''}, 'ending': 'i', 'pos': 'noun'}, {'form': {'number': 'plural', 'declension': 'nominative', 'gender': 'C'}, 'ending': 'i', 'pos': 'noun'}, {'form': {'number': 'plural', 'declension': 'vocative', 'gender': 'C'}, 'ending': 'i', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'genitive', 'gender': 'neuter'}, 'ending': 'i', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'genitive', 'gender': 'masculine'}, 'ending': 'i', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'genitive', 'gender': 'C'}, 'ending': 'i', 'pos': 'noun'}]}], 'word': 'somni'}, {'defs': [{'orth': ['porta', 'portae'], 'senses': ['gate, entrance', 'city gates', 'door', 'avenue', 'goal (soccer)'], 'infls': [{'form': {'number': 'singular', 'declension': 'genitive', 'gender': 'C'}, 'ending': 'ae', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'locative', 'gender': 'C'}, 'ending': 'ae', 'pos': 'noun'}, {'form': {'number': 'singular', 'declension': 'dative', 'gender': 'C'}, 'ending': 'ae', 'pos': 'noun'}, {'form': {'number': 'plural', 'declension': 'nominative', 'gender': 'C'}, 'ending': 'ae', 'pos': 'noun'}, {'form': {'number': 'plural', 'declension': 'vocative', 'gender': 'C'}, 'ending': 'ae', 'pos': 'noun'}]}], 'word': 'portae'}]

Additionaly a hosted version of this can be found on Learning Latin

What needs to be done?

- Add English to Latin translation.
- Filter the results more, to prevent irrelevant results.
- Handel macrons (macrons should be replaced with coresponding normal letter).
- Handel weird characters (everything that is not a letter or a space should be removed).
- Improve the dictionary loops from O(n).
- Create types / interfaces for everything.
- Clean up the code.
Clone this wiki locally