Skip to content

traebracy/chinese-translator-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Chinese Translator

A Python translator program that reads English-to-Chinese word pairs from a text file, translates user-entered sentences, and tracks word frequency during the session.

The project uses an external dictionary file instead of hardcoding every translation directly into the program.

Features

  • Loads translations from english_chinese_dict.txt
  • Stores translation pairs in a Python dictionary
  • Translates each recognized English word into Chinese
  • Uses ? for words that are not found in the dictionary
  • Tracks word frequency across entered sentences
  • Lets the user translate multiple sentences in one run

Concepts Practiced

  • Python dictionaries
  • File handling
  • String parsing
  • User input validation
  • Loops
  • Functions
  • Word frequency counting

How to Run

Make sure chinese_translator.py and english_chinese_dict.txt are in the same folder, then run:

python chinese_translator.py

What I Learned

This project helped me understand how programs can read external data, store it in memory, and use it to create more flexible behavior than a hardcoded script.

About

Python translator that maps English words to Chinese using a text file dictionary.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages