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

  • SEARCH
  • Home
  • 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 8237535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:30:10+00:00 2026-06-07T19:30:10+00:00

Does anyone have a sample code for parsing the CEDICT file? CEDICT is a

  • 0

Does anyone have a sample code for parsing the CEDICT file? CEDICT is a Chinese-English Dictionary. For instance, currently, if I open it in a text editor, a line in the CEDICT file looks like:

不 不 [bu4] /(negative prefix)/not/no/

I would like to see it as:

不 不 [bu4] /(negative prefix)/not/no/

I found Textwrangler to do this for me as a text editor. What I now need is sample code that achieves the same.

  • 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-06-07T19:30:11+00:00Added an answer on June 7, 2026 at 7:30 pm

    The thing is, it’s just an encoding problem. If the line looks like

    不 不 [bu4] /(negative prefix)/not/no/

    It’s because the text editor doesn’t know/realize that the text is encoded as UTF-8. Text Wrangler, or its big brother BBEdit, are very good at guessing encoding, and can even be asked to display text in a specific encoding.

    Since we don’t know what you want, in the end, to achieve, it’s hard to tell you exactly what has to be done, specifically. What I can say is that your app (which language are you using anyway?) needs to be Unicode aware (and be able to read/manipulate UTF strings).

    I wrote a couple of apps based on the CEDICT, one for Mac OS X, one for Android. Parsing and indexing the CEDICT is not very hard.

    UPDATE

    Regarding the parsing itself of the CEDICT, it’s nothing complicated. I don’t do Objective-C, never have, never will, but the process would be the same in any language:

    • Read a line. Say your own example: 不 不 [bu4] /(negative prefix)/not/no/
    • You have four fields: Trad. Ch., Simp. Ch., Reading, Meaning(s).
      These fields are space separated. Of course the 4th field may contain spaces, so be careful.
    • Store (I used an sqlite db) the 4 fields in to db.
      You might want to remove the slashes from the definition field, replace them with something else.
    • Loop

    You have now converted the CEDICT to a database. That’s the easy part. As for tokenizing Chinese, good luck with that, mate. Better minds than mine are still banging their heads on this one.

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

Sidebar

Related Questions

I can attach a file with libesmtp? Does anyone have a sample code? Thanks
Does anyone have sample code to copy open (in-use and locked by another program)
Does anyone have a sample code that given the database file displays the names
Does anyone have sample code, or a tutorial which demonstrates how to use Grappa
Does anyone have some sample code of using a castle windsor InstallerFactory for ordering
Does anyone have sample VBS code that creates a switch statement based on whether
Does anyone have any sample code in Objective C for connecting to an external
Does anyone have sample VBS code that sends a variable, waits response and repeat?
Does anyone have some sample code or can direct me to which class I
Does anyone have sample code for plotting ellipsoids? There is one for sphere on

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.