This is a translator program I built using Python that will take in a sentence in Japanese and translate the parts of the sentence into English and return an English translation.
The original senetence is first split into various parts of speech using Japanese particles, which determines the transitivity of the verb if present and if a copula is present. Each part of speech is further broken down depending on the characters, length, conjugation, pairing, and use.
This program does utilise the googletrans library as making a translator is a near impossible task (even for Google), especially without the use of machine learning.
The main feature of the program is to take the individual parts of the sentence, translate it using a csv with common words in Japanese, match it to a part of speech in English, and return that to the user.
The files in the program are as follows: BasicWords.py -> Has multiple dictionaries and lists with conjugations, copulas, translations, adverbs, and adjectives CleanCommonDataset.ipynb -> Used to take the original, messy dataset of common Japanese words and clean it using Jupyter Notebooks common_japanese.csv -> A csv file cleaned from the original file that has japanese words along with their definitions and readings CreateJLPTDeck.py -> Used to scrape the jisho.org website and download the common dataset used in this program GoogleTranslate.py -> Used to translate the sentence from the user into English semi-accurately Main.py -> Main file for the program that initializes everything and calls all of the methods and variables Translate.py -> Stores various methods to help with the main method. Used extensively
Examples of the program with Japanese inputs:
Transitive Sentences:
With を and は:
With する verb:
With modifier in subject:
With modifier in object:
With の in subject:
Intransitive:
With は and に:
With いる and に:
With 行く and に:
With modifier in location and に:
With の in location and に
With は and が:
With が and ある:
With modifier in object and が:
With の in subject and が:
Copula:
With は:
With が:
With い-adjective:
With な-adjective:
With modifier in object:
With の in subject:
These are just few examples of the translations. The program has its limitations as it only supports 5-6 particles and fairly basic N5 grammar. I hope to continue building onto the program.