Problem importing flashcards from text document

gopleco

Member
I just started an intensive mandarin program and have been using Pleco which is fantastic. I've found a couple posts on the forum about importing sentence flashcards and would love to use this function, although i've run into a problem.

Using the format

characters<tab>pinyin<tab>english

written into the textedit program of our new macbook pro, I save the document as a .xml file. Next, upload the file to ipod touch using the local address, connecting ipod to the macbook with the usb cord the ipod came with. Next, find the File under the Choose file menu within the Import flashcards menu. After clicking begin import, a prompt says the import was successful, although when I go to the organize cards menu, the new imported cards are nowhere to be found. I also tried starting the .xml file with "//new category" but still nothing under the organize flashcards menu.

Any thoughts would be much appreciated.
 

mikelove

皇帝
Staff member
The problem there is that this should actually be a .txt file, not an .xml file - Pleco XML files use a much more complicated format and we don't recommend them for anything but moving cards between Pleco apps (or exporting them from the couple of other websites that support them). Change the file extension to .txt and it should import correctly.
 

gregleg

Member
Good morning,

I have to admit I do not understand how to import files. How should I write the flashcards, how to upload them?

Best,

Greg
 

mikelove

皇帝
Staff member
gregleg said:
I have to admit I do not understand how to import files. How should I write the flashcards, how to upload them?

The format for the files is very simple,:

characters<tab>pinyin<tab>definition

one card per line. Pinyin is preferably done with tone numbers instead of marks, characters simplified or traditional or simplified[traditional] if you want to include both. You can omit the Pinyin or the Pinyin and definition and Pleco will try to fill those in.

You'd save this as a plaintext file, .txt extension, with UTF-8 text encoding; you can save documents in that encoding from Word or a Unicode text editor like EmEditor.

To define a category, insert a line with two slashes in front of it, like this:

// CATEGORY NAME

That puts all of the cards after it in that category, until you insert another line like that to define a different one.

Once you've created your file, you can upload it to your device right in iTunes; connect your device, click on the "Apps" tab at the top of the screen and on "Pleco" at the bottom of the screen and you can use that interface to copy the file over.
 

mingtaizu

Member
Hey Mike et al,

I'm having a little difficulty with importing flashcards from a .txt document. I followed the input format that you described in the previous post, but Pleco doesn't recognize the tones of the traditional characters (which I put in brackets after the simplified characters). Any thoughts?

Thanks,

太祖

~EDIT~

Well, I figured out a way around this. I'm using Snow Leopard and solved the problem by changing the language input from "Pinyin - Simplified" to "U.S." when typing the brackets around the traditional. Hope that this is of some service to someone down the line!
 

mikelove

皇帝
Staff member
mingtaizu said:
Hey Mike et al,

I'm having a little difficulty with importing flashcards from a .txt document. I followed the input format that you described in the previous post, but Pleco doesn't recognize the tones of the traditional characters (which I put in brackets after the simplified characters). Any thoughts?

--

Well, I figured out a way around this. I'm using Snow Leopard and solved the problem by changing the language input from "Pinyin - Simplified" to "U.S." when typing the brackets around the traditional. Hope that this is of some service to someone down the line!

Yes, it currently only supports standard ASCII [ and ] brackets - might be good to support the most common Chinese ones too, though. Thanks.
 

laobaigou

举人
Hello,
Format seems simple enough.. char<tab>pinyin<tab>definition, and it works quite well mostly. However sometimes I don't get 'my' definition, instead I get the definition from some other dictionary. It just seems confused. Is there a paper with some more details about special characters that may be confusing things? I'm trying to have CC entries like:

智<tab>zhi4<tab>[chih4]‘knowledge, wisdom’; cf. 知 chih1 verb (often written 知.) (N)

(i.e the wade is included in the definition, for reference) Works sometimes, but for this particular example, it comes up with a totally different definition). What am I missing? All the other stuff like importing works fine. No problems. Thanks for any help.
 

mikelove

皇帝
Staff member
laobaigou said:
(i.e the wade is included in the definition, for reference) Works sometimes, but for this particular example, it comes up with a totally different definition). What am I missing? All the other stuff like importing works fine. No problems. Thanks for any help.

There's probably already another card in your database with the same characters and Pinyin - our system tries by default to avoid duplicates, so it's putting the old card in the new category rather than creating a new card. If you set "Duplicate cards" in the Import screen to "Replace" it'll delete the old card when it creates the new one, if you set it to "Allow" it'll create a separate card with the new definition even if it means that you now have two different cards for that word.
 

laobaigou

举人
You suggestion of course solves the problem perfectly/ Thanks a lot. Pleco is a great product!! Next question: as I accumulate these entries I would like to put them in their own dictionary - e.g. 'MYC' that appears along with CC, CC, PLC, etc. I see that I can individually import them into USR, but that isn't really what I want; I want my own dictionary! I've looked for hints, and I see some, but also copyright infringement worries if this were opened up. Is it even possible? If so, where is the documentation? If it is not possible is it possible to import all my own definitions into USR at one time and not each individually? Thanks again.
 

mikelove

皇帝
Staff member
laobaigou said:
You suggestion of course solves the problem perfectly/ Thanks a lot. Pleco is a great product!! Next question: as I accumulate these entries I would like to put them in their own dictionary - e.g. 'MYC' that appears along with CC, CC, PLC, etc. I see that I can individually import them into USR, but that isn't really what I want; I want my own dictionary! I've looked for hints, and I see some, but also copyright infringement worries if this were opened up. Is it even possible? If so, where is the documentation? If it is not possible is it possible to import all my own definitions into USR at one time and not each individually? Thanks again.

It's certainly possible - the copyright concerns were mostly about making it friendlier to large (100,000-entry e.g.) dictionaries, which right now tend to import rather slowly.

See this section of the manual for documentation - if you already have USR then you can simply tap on its name in Manage Dicts and tap on "Import Entries" to import entries from your text file.
 

laobaigou

举人
The dictionary worked out perfectly; thanks. Next question; I have entries like:
智<tab>zhi4<tab>[chih4] ‘knowledge, wisdom’.....
where the wade is also there, and I'd like to have the wade tone numbers in superscript; I've tried utf-8 '&#....;' syntax and though the numbers seem to be recognized as numbers, they are not in superscript. Is there some list of special characters that work w/in dictionary and flashcard entries?, and in particular is there a way to superscript and maybe bold? How about colors? Thx yet again!!
 

mikelove

皇帝
Staff member
laobaigou said:
where the wade is also there, and I'd like to have the wade tone numbers in superscript; I've tried utf-8 '&#....;' syntax and though the numbers seem to be recognized as numbers, they are not in superscript. Is there some list of special characters that work w/in dictionary and flashcard entries?, and in particular is there a way to superscript and maybe bold? How about colors? Thx yet again!!

For superscript you'd want the actual Unicode character rather than the HTML &# character code - it should look like a superscript in your text file editor too, in other words. They should render fine as long as they're added that way.

Formatting codes are unofficially supported, but they're a bit tricky since you have to enter custom private-use Unicode characters, and they might change in a future release.
 

laobaigou

举人
Worked great. Thanks. I just wrote a little Perl script that sticks the superscript chars in the content portion, skipping the pinyin. Superscript 1 is 0xc2b9, 2 is 0xc2b2, 3 is 0xc2b3, and 4 is 0xc381b4.
 
Top