Ruslan Popov's personal website

Student of DNU Faculty of Physics, Electronics and Computer Systems


Home | Github | Projects | Papers

Source: Github repository.

English to logic translator

A simple translator written in Racket.

The program supports:

It does not support:

The program has some critical flaws that are discussed in file notes.txt.

Algorithm

Input: an English sentence as a string. Output: a pair of a logic expression (using prefix notation) and an association list of a logic variable and its string.

  1. Downcase the input
  2. Remove punctuation.
  3. Split string into words (or tokens) by whitespace.
  4. (Parsing) Recursively extract logic operators.
  5. Assign variable names to vars and create an output.

Parsing algorithm


Copyright (c) 2023 Ruslan Popov

My email: ruslanpopov1512@gmail.com; popov_ro@ffeks.dnu.edu.ua.

You can find me everywhere by this nickname: InAnYan.