Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 612259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:52:25+00:00 2026-05-13T17:52:25+00:00

I am trying to do transliteration where I need to replace every source character

  • 0

I am trying to do transliteration where I need to replace every source character in English from a file with its equivalent from a dictionary I am using in the source code corresponding to another language in Unicode format. I am now able to read character by character from a file in English how do I search for its equivalent map in the dictionary I have defined in the source code and make sure that is printed in a new transliterated output file. Thank you:).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:52:25+00:00Added an answer on May 13, 2026 at 5:52 pm

    The translate method of Unicode objects is the simplest and fastest way to perform the transliteration you require. (I assume you’re using Unicode, not plain byte strings which would make it impossible to have characters such as 'पत्र'!).

    All you have to do is layout your transliteration dictionary in a precise way, as specified in the docs to which I pointed you:

    • each key must be an integer, the codepoint of a Unicode character; for example, 0x0904 is the codepoint for ऄ, AKA “DEVANAGARI LETTER SHORT A”, so for transliterating it you would use as the key in the dict the integer 0x0904 (equivalently, decimal 2308). (For a table with the codepoints for many South-Asian scripts, see this pdf).

    • the corresponding value can be a Unicode ordinal, a Unicode string (which is presumably what you’ll use for your transliteration task, e.g. u'a' if you want to transliterate the Devanagari letter short A into the English letter ‘a’), or None (if during the “transliteration” you want to simply remove instances of that Unicode character).

    Characters that aren’t found as keys in the dict are passed on untouched from the input to the output.

    Once your dict is laid out like that, output_text = input_text.translate(thedict) does all the transliteration for you — and pretty darn fast, too. You can apply this to blocks of Unicode text of any size that will fit comfortably in memory — basically doing one text file as a time will be just fine on most machines (e.g., the wonderful — and huge — Mahabharata takes at most a few tens of megabytes in any of the freely downloadable forms — Sanskrit [[cross-linked with both Devanagari and roman-transliterated forms]], English translation — available from this site).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 305k
  • Answers 305k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Looks like you misspelled "adapter" in your arguments. -er and… May 13, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer You have nothing to worry about. The performance impact of… May 13, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer In an insert statement you wouldn't have an existing row… May 13, 2026 at 9:06 pm

Related Questions

I am trying to do some string concatenation/formatting, but it's putting all the parameters
I am trying to do something I've done a million times and it's not
I am trying to do a search in my Eclipse (Java) workspace to find
I am trying to do the following in ASP.NET 3.5. Basically, I am binding
I am trying to do this... <Image x:Name=imgGroupImage Source=Images\unlock.png Margin=0,0,5,0 /> But I get

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.