I want to help teach to a minority group in Milwaukee, so I want to create a dictionary program that translates a sentence (like a homework problem or teacher instructions), from English into Hmong.
I have one Idea, and that is to have an English text file of all the A-words, then a Hmong text file of the proper translations. Each text file would have the same amount of lines, with one english word per line, then translated to hmong. Would it be even possible to..
1. user inputs question, "Describe the holocaust"
2. describe is looked in the d text (like if d, search d.txt), then the word is found. then it either compares it to a translation txt (like hmong-d.txt), spitting out the word. then it would prompt to the next word to translate, one line at a time.
A different way was to have 1 giant text file for each letter. like look up "albino", when it finds the word in the a a-dictionary, it searches for the albino string, then finds the comma, then spits out the word/words after the comma. would this be possible as well? which method is easiest for someone that hasn't c++ in a few years?
so far I have a useless code typed up. i just want to start simple getting a-words to work, then get more complex from there. once i have a start i can go with it. please help me, i would love to reach the needs of my esl students who could use this greatly in the US.
summary,i want to take a line of words, compare each word to a specific dictionary, then output one line at a time, the translation. thank you so much!
this code is not correct:
#include <iostream> // I/O
#include <fstream> // file I/O
#include <iomanip> // format manipulation
#include <string>
//This program will hopefully translate english to hmong
using namespace std;
string english; //declare english word to translate
string search; //what to search
int main()
{
cout << "Type the english words here, then press enter. Make sure to copy the words correctly. If you need to spell check use www.google.com" ;
cin >> english;
ifstream myFile;
myFile.open ("c:\\eAh.txt") ;
string* search = english; //search using input
int offset; // where it was found (or not (-1))
if ((offset = line.find(searc h, 0)) != string::npos) {
cout << "found '" << search << "' @ offset " << offset << endl;
}
return 0;
}
I have one Idea, and that is to have an English text file of all the A-words, then a Hmong text file of the proper translations. Each text file would have the same amount of lines, with one english word per line, then translated to hmong. Would it be even possible to..
1. user inputs question, "Describe the holocaust"
2. describe is looked in the d text (like if d, search d.txt), then the word is found. then it either compares it to a translation txt (like hmong-d.txt), spitting out the word. then it would prompt to the next word to translate, one line at a time.
A different way was to have 1 giant text file for each letter. like look up "albino", when it finds the word in the a a-dictionary, it searches for the albino string, then finds the comma, then spits out the word/words after the comma. would this be possible as well? which method is easiest for someone that hasn't c++ in a few years?
so far I have a useless code typed up. i just want to start simple getting a-words to work, then get more complex from there. once i have a start i can go with it. please help me, i would love to reach the needs of my esl students who could use this greatly in the US.
summary,i want to take a line of words, compare each word to a specific dictionary, then output one line at a time, the translation. thank you so much!
this code is not correct:
#include <iostream> // I/O
#include <fstream> // file I/O
#include <iomanip> // format manipulation
#include <string>
//This program will hopefully translate english to hmong
using namespace std;
string english; //declare english word to translate
string search; //what to search
int main()
{
cout << "Type the english words here, then press enter. Make sure to copy the words correctly. If you need to spell check use www.google.com" ;
cin >> english;
ifstream myFile;
myFile.open ("c:\\eAh.txt") ;
string* search = english; //search using input
int offset; // where it was found (or not (-1))
if ((offset = line.find(searc h, 0)) != string::npos) {
cout << "found '" << search << "' @ offset " << offset << endl;
}
return 0;
}
Comment