Skip to content

A translator between the constructed language Toki Pona and English; originally Patrick-Woelfle/Toki-Pona-Translator

License

Notifications You must be signed in to change notification settings

effekt-community/Toki-Pona-Translator

 
 

Repository files navigation

Note

This is a community-maintained fork of a MIT-licensed student project in the Effective Programming with Effects course in winter semester 2024/2025. Be warned that this is not an officially endorsed project, the code in this repository may be not idiomatic Effekt.

The original repository is https://github.com/Patrick-Woelfle/Toki-Pona-Translator

Toki Pona Translator

This project is part of the Effective Programming with Effects course.

Table of contents

Links

Description

A tool for translating between the constructed language toki pona and english. Toki Pona is used by a rather large community on different discord servers and forums, but there doesn't yet exist a good translator, making the project potentially usefull for people trying to learn the language. The translating will be done by creating syntax trees for the toki pona sentence, which is fairly simple in toki pona since there aren't a lot of different sentence constructions, then translating every word individually, which is also fairly simply because of the limited vocabulary, and then constructing an english sentence using the syntax tree and translated words.

User Documentation

  • Clone this Repository locally and open it in VSCode
  • Install the Effekt VSCode extension offered in the pop-up in the bottom right
  • To translate sentences over the command line, execute the main function of commandLineInterface.effekt
  • To translate sentences over the web interface, navigate into webUI, and execute node server.js

Developer Documentation

  • See ARCHITECTURE.md

Current Progress

  • Can detect most toki pona sentences, with the exceptions of some more complicated constructions:
    • Particle la
    • Particle anu
    • Questions
    • Using prepositions as verbs
  • Examples for sentences that can currently be translated are in test.effekt

Plan

Must-have

  • User can Input any sentence, and if it follows the grammar of toki pona, receive an english translation or multiple if the sentence is ambigous

Can-have

  • Translation of english sentences to toki pona, with a limited vocabulary and grammatic constructions
  • Spell checking for toki pona words, to detect what the user might say
  • A gui and/or web-interface to make it available to other people

Will-not-have

  • Full translation between english and toki pona, since english grammar is to complex to be translated using simple algorithms or to be expressed in toki pona

Effects and handlers

  • Since toki pona is based on words having a broad meaning, ambiguities could be handled with a handler that uses multiple continues
  • Misspelled words could be implemented as an effect, which has a handler that asks the user for clarification or corrects the word if it's close to a known one
  • Missing words in syntax trees could also be implemented as an effect, whith a handler that determines how the programm should continue

FFI and libraries

  • For the syntax trees a tree like structure to store the data would be helpful. I don't think one exists in the standard library, but writing one should be fairly easy
  • The translating itself doesn't need any other FFI/libraries, only if I get to the point making a gui or web-interface this might be important, but there should be enought options that one works well.

About

A translator between the constructed language Toki Pona and English; originally Patrick-Woelfle/Toki-Pona-Translator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.2%
  • Other 0.8%