Research Article

Quantum Neural Network Based Machine Translator for Hindi to English

Algorithm 1

Step  1. Check whether the sentence is Complex sentence or Simple Sentence
      Initialize. Set ICOUNT = 1, NCOUNT = 1, CCOUNT = 1, ILOC, NLOC, CLOC.
     Repeat for LOC = 1 to :
       if SENTENCE LOC = “Interrogative word”, then:
         Set ILOC ICOUNT LOC,
         ICOUNT = ICOUNT + 1.
         End of if structure
       if SENTENCE LOC = “Negative word”, then:
         Set NLOC NCOUNT LOC,
         NCOUNT= NCOUNT + 1.
         End of if structure
       if SENTENCE LOC = “Conjunction”, then:
         Set CLOC CCOUNT LOC.
         CCOUNT = CCOUNT + 1
         End of if structure
      End of for
     if ILOC = NULL, or NLOC = NULL, or CLOC = NULL, then:
       Go to Step  5.
Step  2.     Remove the interrogative word from the complex sentence to make it Affirmative.
       Repeat for = 1 to ICOUNT
          Set ITemp := SENTENCE ILOC .
          Set SENTENCE ILOC := Null.
        End of for
Step  3. Then Remove the negative to make it simple sentence
       Repeat for = 1 to NCOUNT
          Set NTemp := SENTENCE NLOC .
          Set SENTENCE NLOC := Null.
        End of for
Step  4. Split the sentence into two or more simple sentences on the basis of conjunction.
       Repeat for = 1 to CCOUNT
          Set CTemp := SENTENCE CLOC .
          Set SENTENCE CLOC := Hindi Full-stop (“∣”).
        End of for
Step  5.  Pass each sub sentence with TOKEN to QNN based Machine Translator for reposition.
Step  6. Refine the Translated sentences by applying the grammar rules.
Step  7. Add the interrogative word if removed in Step  2.
       Repeat for = 1 to ICOUNT
          if ITEMP = NOT NULL
       Set SENTENCE ILOC := ITemp .
           End of if structure
        End of for
Step  8. Add the negative word if removed in Step  3.
       Repeat for = 1 to NCOUNT
          if NTEMP = NOT NULL
       Set SENTENCE NLOC := NTemp .
           End of if structure
        End of for
Step  9. Rejoin the entire sub sentences, if split in Step  4.
Step  10. Semantic Translation
Step  11.  Exit.