vb6 sentence translation code?! help

vb6 Somalia
  • 14 years ago

    I finished my project which handles multiple language translation but it translate only words by searching the appropriate word from my database now i changed my mind i want a help how i can translate sentence or one line by a code using vb6?!

    I welcome any suggestions, any help & any source codes

    thnx

  • 14 years ago

    Hi Mahdi
     Actually in ur database u r having translate sentence for one word.
     If u want to transalate line by line then u should use stringmanipulation.

    ex:
     pass the line string into one string variable(strLine)
     after that create split array with the delimiter as "space"  (strArr=split(strLinem,"char(32)")  ' char(32) as space

    use for loop and upto ubound(strarr)
     translate one by one and pass into new string variable


    finally pirnt the new string variable

    I hope this logic may useful for u

    Regards
    Hari K


























  • 14 years ago

    Thanks Khari so much

    but i would like if you can give me alink of source code relate to that subject

    i would be so grateful

    thanx again

     

  • 14 years ago
    Hi Mahdi

    http://www.vbforums.com/archive/index.php/t-121667.html
    http://www.devx.com/vb2themax/Tip/19090
    http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21195163.html

    Regards
    Hari K










  • 14 years ago
    thanks Hari K
  • 14 years ago

    thanks again but the links you gve me only talks about how to read files?!

    and my question was how i can translate sentences by using the same database i have which is stored in ms access as words not sentences!

    i think you got it now my question?

    this project will only translate words by looking the appropriate word from the database but i need to handle the whole sentences and search it word by word and translate it as a whole?

    can i do that?

    do u have any idea about this?

    thanks hari K again 

  • 14 years ago

    HI

    there is popular dictionaries coded in this way like alwafi it translate pages for english to arabic

    do you want your application like this way if not what is the differnce?

    VBlover

  • 14 years ago

    HI VBlover

    Could you please post something useful or ask serious questions "not like this one"?! please

    Could you please show us if you really love visual basic?!

    please

    i would be so grateful

    regards and thanks

    DoctorMahdi

  • 14 years ago
    Hi Mahadi,
     Actually in ur database u r having only the word wise translation. So that u take the sting(One line). And take this and put into an Array using the split command. In this array u shoul maintain words not hole line. After that u translate all the array words into one string u got the hole translate sentence.
    Logic for Ex:
    dim strArray() as string
    dim iCount as integer
    dim strFinal as string
        strFinal=""
    do while EOF(txtFile)
        strText=LineString
        strArray=Split(strTextm,"Ascii of Space char")
        for icount=0 to Ubound(strArray)
           strFinal=strFinal & Translated word(strArray(iCount)) & " "
        Next iCount
        Strore strFinal
        strFinal=""
    Loop

    I hope the above logic will helpful for u

    Mahdi, First u understand onething system never understand ourself. Make that our application will going to do our requirement. So we are the right person to guid that our application.Just for fun(LOL).

    So system cann't translate hole sentence because u r having only word for translate in ur database. So we make our application to translate the whole page line by line in visual. But we did our application to translate word by word. But visually its doing like line by line.

    keep touch with me.

    Good Luck


    Regards
    Hari K
































  • 14 years ago

    Hi Khari
    Thanks for the good tip but as you know coding for such an application is so complex
    1/like accounting for the grammatical structure of the source language into the target language this also stresses the fact that machine is not simply substituing words for other words but like human translation it involves the application of complex linguistic rules especially in morphology, syntx and sematics
    2/bi-directional translating in both directional translation back and forth
    3/distingishing between Autonomous
    I found alot of obstacles that i can't post it here
    At last "give your servant orders in a language that he can undrstand it!"  that is the computer
    so machine aided translation (MAT) is the only way that can solve my problem, I think so
    If there is a source code of an application like this i will be so glad.
    thanks again
    regards
    DoctorMahdi










  • 14 years ago

    Hi Khari
    Thanks for the good tip but as you know coding for such an application is so complex
    1/like accounting for the grammatical structure of the source language into the target language this also stresses the fact that machine is not simply substituing words for other words but like human translation it involves the application of complex linguistic rules especially in morphology, syntx and sematics
    2/bi-directional translating in both directional translation back and forth
    3/distingishing between Autonomous
    I found alot of obstacles that i can't post it here
    At last "give your servant orders in a language that he can undrstand it!"  that is the computer
    so machine aided translation (MAT) is the only way that can solve my problem, I think so
    If there is a source code of an application like this i will be so glad.
    thanks again









    Regards
    DoctorMahdi

  • 14 years ago

    Hello DoctorMahdi..

    I have to do project in VB6 to convert word from English to Arabic and i think is like your project ..

    So, please can i have a copy of the code...

    thank a lot ... for read my message and help...

  • 14 years ago

    Hi bodoora

    Could you explain more how your project works?

    are using a database for storage? if yes what kind of it?

    is it single word translator? or something else

    Please give more information

    Regards

    DoctorMahdi

     

  • 14 years ago

    Hi DoctorMahdi…

    In my project we translate each words in a sentence to there root in Arabic but the translation we

    have it in English language like the example below: (These is for one word) 

     

    INPUT STRING: شمس
    LOOK-UP WORD: $ms
      SOLUTION 1: ($amasa) [$amas-u_1] $amas/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
      SOLUTION 2: ($amisa) [$amis-a_1] $amis/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
      SOLUTION 3: ($am~asa) [$am~as_1] $am~as/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
      SOLUTION 4: ($amos) [$amos_1] $amos/NOUN 
     





    And these words (SOLUTION) we put it in a pop menu but they are in English and we want to translate it to Arabic like this:

    $amasa    to    شّمّسّ

    $amisa     to    شّمِسّ

     

    We put all letters (English and Arabic) in the Database, and I want you to help me to do the translation to the word by the letters.

    Thanks a lot...

     

    Regards

    Bodoora 

     

  • 14 years ago

    Hi DoctorMahdi....

    In my project we translate each word in a sentence to there root in Arabic but the translation we have it in English language like the example below: (these is for one word)

    INPUT STRING: شمس
    LOOK-UP WORD: $ms
      SOLUTION 1: ($amasa) [$amas-u_1] $amas/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
      SOLUTION 2: ($amisa) [$amis-a_1] $amis/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
      SOLUTION 3: ($am~asa) [$am~as_1] $am~as/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
      SOLUTION 4: ($amos) [$amos_1] $amos/NOUN
      SOLUTION 5: ($amos) [$amos_2] $amos/NOUN_PROP





    And these words (SOLUTION) we put it in pop menu but they are in English and we want to translate it to Arabic like:

    $amasa  to             شّمّسّ    

    $amisa   to             شّمِسّ         

    We put all letters (English and Arabic) in the Database, and i want you to help me to do the translation to the words by letters.

    Thanks a lot...

    Regards

    Bodoora

  • 14 years ago

    Hi bodoora

    I changed my code to away that you can't use in your project it's completely different as it was

    But The following source code will help you (Click here)

    another source code (Click here), also check this one

    Any more questions will be welcomed?

    Regards

    DoctorMahdi

  • 14 years ago

    Hi bodoora

    I completely changed my code that you can't use in your project But I offer the following source codes that will help you download it from the following links

    Code1

    Code2

    Code3

    NB: something wrong happened i wrote this post but it only duplicated yours so next time try your post to be left to right direction

    Regards

    DoctorMahdi

     

  • 14 years ago

    Hi DoctorMahdi...

    Thank you very much... about the code U sends...

    I will read them

  • 14 years ago

    Hi DoctorMahdi...

    Thank you very much... about the code U sends to me ...

    I will read them. and if i want any think i will send to U...

    thanks again...

    Regards

    Bodoora

     

  • 14 years ago

    Hi bodoora

    How many english and arabic words do you have in your recordset?

    is your translation in uniderectional or biderectional?

    Regards

    DoctorMahdi

  • 14 years ago

    Hi DoctorMahdi

    In recordset i have english and arabic letters not words and thy are 45

    i want to do translation in uniderectional from english to arabic

    and in this source you can see the leteers (translation)

    http://www.qamus.org/transliteration.htm

    And in my project i want to translate words by these letters

    Thanks...

    Regards

    Bodoora

  • 14 years ago

    Hi bodoora

    The link is broken!

    Regards

    DoctorMahdi

  • 14 years ago

    Hi...

    In my project (VB6) I have code is run in  Command Prompt (DOS) and in the same time i want progress bar work with DOS then they must go to other form (form2)...

    but i dont know how can i connecting the statement to work with each other?

    please help me if any body have an idea...

    regards

    bodoora

     

  • 14 years ago
    I don't undrstand it where do you want to put the progressBar & where the form2 located?
  • 14 years ago

    Hi DoctorMahdi...

    This is my code and there are some command in the code for what i want to do

    and where i want help... 

    Private Sub start_Click()
    Dim Apath As String

    'if no text loaded or no text typed
    If txtFileText.Text = "" Then
    MsgBox "Please Load a Text "
    'if the text is in textbox
    Else



    'first erase any text in the file
    Open "C:\buckwalter_morphan_1\data\infile.txt" For Output As #1

    'write the text that user want to tag in the file
    Print #1, txtFileText.Text
    Close #1

    '**these statement to open DOS**
    'open command prompt to run Perl script
    Open Apath & "dos.bat" For Output As #1
        Print #1, "cd C:\buckwalter_morphan_1\data"
        Print #1, "perl -w AraMorph.pl < infile.txt > outfile.txt"
         Close #1
          
        ' ShellAndWait Apath & "dos.bat"
        Shell Apath & "dos.bat"







    '**this is for run progress bar**
    ProgressBar1.Value = 1
    Timer1.Enabled = True

    '**How can we connect DOS and progress bar to work together
    '** in the same time then after finish there work move to form1?**
    Form1.Show


    End If

    Thanks for replay

    Regards

    Bodoora

  • 14 years ago
    Private Sub Command1_Click()
    While ProgressBar1.Value < ProgressBar1.Max
    Do
    ProgressBar1.Value = ProgressBar1.Value + 1
    Text1.Text = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"
    Text1.refresh
    Loop
    Wend
    End Sub









Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“XML is like violence - if it's not working for you, you're not using enough of it.”