i want to create a program that translates a sentance in english to another language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahammad
    New Member
    • May 2007
    • 79

    #76
    I'm pretty sure that my code can be modified to do that one way or another

    Comment

    • DeMan
      Top Contributor
      • Nov 2006
      • 1799

      #77
      Originally posted by weaknessforcats
      With all this translating of words, have you considered that this will not translate one language into another language?
      Too true, this may be an urban myth, but apparently someone tried to create somethuing like this for English-Russian and Russian-English.

      Entering the phrase "The spirit is willing, but the flesh is weak" and translating it first to Russian then back to English, gave "The Vodka is strong, but the meat is rotten" - Not quite the same thing

      Comment

      • ahammad
        New Member
        • May 2007
        • 79

        #78
        Okay, I've made a few tweks to my program and I can get it to do this:

        In the Console window:
        Code:
        Please enter the source file name: test.txt
        Abdomen = Plab mog
        Able = Rooj
        Able = Ua tau
        Abortion = Rho menyuam tawm
        About = Li ntawm
        Above = Saum toj
        Please enter a word (type 'abort' to exit>: Abdomen Abortion About Above
        Plab mog  Rho menyuam tawm  Li ntawm  Saum toj
        It still needs more work with making it loop and getting it to correctly display new lines after every sentence. As it stands now, it simply translates each word individually

        Comment

        • jerger
          New Member
          • May 2007
          • 77

          #79
          wow cool! can i see what you mean? did you post the code? that sounds awesome!

          i'm also going to research this getline thingy...

          ideally what is needed is a breakdown of words, so that kids can use it like an instant dictionary for social studies, so if the question is confusing at least 3-4 words would be helpful (expecially social studies terms that are rare)


          **** wait???

          what does your program do lol. i need it to translate a specific sentance... so like ask user "please enter your sentance to be translated"... then look either in the program or a text file and search for the specific words that the person inputed in english, then translated them into hmong. is that what it does?


          i'm just confused on the program maybe, it looks promising... is there a way to input like 5000 words without saying each word in the dictionary? (maybe im wrong but it looks like it read in every line of the text)... then you typed english and it worte in hmong.

          thats cool!

          it might not make sense in hmong which is ok. but idealy i would like it to say each word on a seperate line to reduce confusion.

          why? well you have to study the language.

          love = hlub
          i = kuv
          you= koj

          but if you take like 5 different words and put them near eachother you might make a new word...

          for instance.... maj mam swb means crawl but ... maj mam =slowly and speak = maj mam hais

          so if you accidently have a word like slowly and then hais which means sais, scoop... it might translate as "speaks slowly" instead of crawl speak... i dont know how to say it, this might work... but might get confusing...

          since if you write a whole bunch of words together in hmong, they create a new word...

          word 1=definition
          word 2 = definition

          but if you put word 1 next to word 2 it COULD create a new word if not in proper sentance structure... so it might be best to output each word seperatly.. so i could break up your output in hmong to one line each right?


          *** update i see that you spaced stuff out when i looked more closely i can simply put an asterisk between it to seperate words... so cool! but still confused on the first part ... is there a way to input text file behind scenes, load it behind scenese then translate? such a cool way to do it tho)

          i guess to make it behind scenes i could load dictionary.txt in the background? before asking hte question... saying like "please wait while dictionary loads, if you recieve an error message please make sure dictionary.txt is located in the same folder as this program"

          Comment

          • ahammad
            New Member
            • May 2007
            • 79

            #80
            Code:
            i'm just confused on the program maybe, it looks promising... is there a way to input like 5000 words without saying each word in the dictionary? (maybe im wrong but it looks like it read in every line of the text)... then you typed english and it worte in hmong.
            You are right, it does display every single line of the text file. I only put that in for testing purposes though, to make sure everything was read in properly.

            Here is the console output with some changes made to it:

            Code:
            Please wait while the dictionary loads...
            Please enter a word or a sentence:
            Abdomen
            Abdomen = Plab mog
            Able
            Able = Ua tau
            Abortion
            Abortion = Rho menyuam tawm
            About
            About = Li ntawm
            Above
            Above = Saum toj
            Abdomen Above About Able
            Abdomen = Plab mog
            Above = Saum toj
            About = Li ntawm
            Able = Ua tau

            I just did a few test cases with single words and whole sentences. I "hard-coded" the file containing all the definitions in the program's code and made each word show separately on different lines. I didn't add a termination command, so the program keeps taking words in forever (it wouldn't be hard to fix that though).

            Comment

            • jerger
              New Member
              • May 2007
              • 77

              #81
              wow so cool! what happens if you enter in an entire sentance?

              this seems more efficient then my method!

              how long is the loading time?

              is this c++ or vc++?

              would you post or pm the code? this is greatly appreciated.

              the hmong community would really benefit from this. since many students are refugee and since they face much racism in wisconsin even by faculty, there isn't much ESL support. the wisconsin program today as a majority has translators and will not license hmong teachers or people who can speak hmong saying there isn't a demand for billingual education. however they do offer bilingual courses for spanish students! so their goal is generally to save money or to assimilate people. (which I have been scolded at UWM for having these opinions, but I was informed by milwaukee public schools there is no need for a social studies teacher that can speak hmong, even though there are 80 esl students at my school 0.o )

              if you don't know, hmong people are in the US for supporting america in the vietnam war. after the war they were put on extermination lists and many women and children were found in the jungles of laos an excecuted. today, many still live in refugee camps and are on the run in laos jungles. so any help to help reach thier education needs is greatly appreciated.

              can't wait!

              Comment

              • ahammad
                New Member
                • May 2007
                • 79

                #82
                I did try to put in a sentence, look at line 13.

                This is using Visual Studio 2005.

                It runs virtually instantaneously . I'm having trouble with my testing tools so I can't give you an exact number. The computer I'm using is top spec, so it may be different but I'm not sure.

                Comment

                • jerger
                  New Member
                  • May 2007
                  • 77

                  #83
                  you are awesome! thanks so much man... i looked at the sentance.

                  THIS IS EXACTLY WHAT I WANTED IT TO DO! WOOT.

                  what about the code? if you don't want to share it i understand. but if that is the case, does it work with any dictionary text file? if so what did you name that file in your code?

                  Comment

                  • ahammad
                    New Member
                    • May 2007
                    • 79

                    #84
                    Originally posted by jerger
                    you are awesome! thanks so much man... i looked at the sentance.

                    THIS IS EXACTLY WHAT I WANTED IT TO DO! WOOT.

                    what about the code? if you don't want to share it i understand. but if that is the case, does it work with any dictionary text file? if so what did you name that file in your code?
                    I am somewhat reluctant to post the code, but it is for a valid and good cause. I'm not sure what you mean by "dictionary text file" though...in any case, I am not at my work computer anymore and I don't have the file saved elsewhere. You'll have to wait till Monday.

                    If you need it BADLY, I may be able to get it tomorrow if someone is at work. Let me know.

                    Comment

                    • jerger
                      New Member
                      • May 2007
                      • 77

                      #85
                      well pm me and see if my pm is working lol i'll send you my email, i wouldn't share it.

                      i meant, where are the words stored? because i need to compile a list of many words.... related to school and then over summer add several other words from different education dictionaries, medical dictionaries etc...

                      or is the dictionary in the program itself? or is it a separate file i can edit?


                      i don't NEED the code right now lol.. but i'm just anxious so i can wait till monday. heck you did this for me, i can wait hahaha. i'm just excited

                      Comment

                      • DeMan
                        Top Contributor
                        • Nov 2006
                        • 1799

                        #86
                        Originally posted by jerger
                        well pm me and see if my pm is working lol i'll send you my email, i wouldn't share it.
                        A much better idea, methinks!!

                        Comment

                        • ahammad
                          New Member
                          • May 2007
                          • 79

                          #87
                          Check your PM's..........

                          Comment

                          • jerger
                            New Member
                            • May 2007
                            • 77

                            #88
                            anyone know where i can get header files/library classes that are used in visual studio c++, but are not in dev c++ or visual c++? i am having compiler issues since i do not have visual studio... and then have missing header/libraries

                            Comment

                            • DeMan
                              Top Contributor
                              • Nov 2006
                              • 1799

                              #89
                              Any idea of the particular libs that may be missing?

                              Comment

                              • weaknessforcats
                                Recognized Expert Expert
                                • Mar 2007
                                • 9214

                                #90
                                [quote=jerger]
                                anyone know where i can get header files/library classes that are used in visual studio c++, but are not in dev c++ or visual c++? i am having compiler issues since i do not have visual studio... and then have missing header/libraries
                                [/jerger]

                                Visual Studio and Visual C++ are the same. Visual C++ is just a part of Visual Studio.

                                There should be no special classes used only by Visual Studio. If you are using ANS/ISO C++ then dev C++ has everything you need. If you are writing Windows code, then the Win32 should be available as a library with dev C++.

                                Only if you are using something like C# should you have trouble like this.

                                Comment

                                Working...