any formatting possible for Definition field?

jyh

秀才
Is it possible to do a bit of formatting of the Definition field of a flashcard by adding end-of-line characters? Ideally in the text file input by Pleco, but I still would be glad for a solution that involves more work in the card editor.

It's weird because, when I edit the Definition field in the card editor, I can use Return to add end-of-lines to make the field look the way I want, but when I go back to viewing the card the eol characters have been replaced by space characters.

I am trying to use Pleco to make flashcard for the Heisig book, so of course I have to stuff a lot of information in that Definition field (the "meaning" word for the character, possibly "primitive" info, and then my little made-up story to accompany the character and help me memorize it). An additional field (say, "Annotation" or "Comments" after an optional third tab in the text file, which should not break any existing flashcards) would help, but really what I am looking for is a way to get a flashcard to recognize a \n character.
 

jyh

秀才
mikelove said:
for an unofficial method using private-use character codes. (still supported as of 2010 and on iPhone, but not guaranteed to remain that way forever)

Thank you for replying so promptly. I haven't figured out yet how to incorporate these tags in my cards (is this something done in the text or XML file, or rather done post-loading, in the card editor?) but I am sure that I will eventually get it.

Not worried about the feature going away in a future version. The flashcard system is so good that I will have memorized all my cards before the new version comes out. :)
 

mikelove

皇帝
Staff member
jyh said:
Thank you for replying so promptly. I haven't figured out yet how to incorporate these tags in my cards (is this something done in the text or XML file, or rather done post-loading, in the card editor?) but I am sure that I will eventually get it.

You'd probably want to use a Unicode text editor with an "insert character code" option (I think MS Word can do it, actually), though you should also be able to make this work with XML entity codes.
 

calkins

秀才
I am also very interested in getting line breaks in the definition field. One thing I don't like about Pleco for iPhone/iPod is that vocabulary (those that have numerous definitions and example sentences) can be very difficult to read, due to the fact that there are no line breaks. I miss the line breaks from Pleco for Palm (my Palm recently broke).

I've tried using the tag EAB1 (as mentioned in Mike's link above), but it didn't work (in a text file uploaded from my Mac to Pleco for iPod).

I would love to get the final result in Pleco to look like this:

室友
shìyǒu

N: roommate / housemate

我跟小林以前是室友, 現在不住在一起了。
I was roomates with Xiao Lin before, but now we don't live together.



...but it always ends up looking like this:

室友
shìyǒu
N: roommate / housemate我跟小林以前是室友, 現在不住在一起了。I was roomates with Xiao Lin before, but now we don't live together.


Any help would be greatly appreciated, thanks!
 

mikelove

皇帝
Staff member
Hmm... what about if you format the flashcards as an XML file and embed newlines in the definition in that, does that work any better?

(the XML format isn't well documented / supported yet, but export a few cards in XML format with Statistics turned off under "Include Data" and it should be pretty easy to figure out)
 

calkins

秀才
Hi Mike,

Thanks for the response. I tried your suggestion but I couldn't get it to work.

I exported 3 existing cards in XML format, per your directions. On the iPod (before export), they all essentially looked similar to this:

室友
shìyǒu

N: roommate / housemate

我跟小林以前是室友, 現在不住在一起了。
I was roommates with Xiao Lin before, but now we don't live together.

I then exported and opened the XML file in Dreamweaver, saving the file without making any changes. I then uploaded it to the iPod and all formatting was lost (line breaks and color) - it looked like this:

室友
shìyǒu
N: roommate / housemate我跟小林以前是室友, 現在不住在一起了。I was roomates with Xiao Lin before, but now we don't live together.


I would prefer working in a text file, as the XML file is pretty complicated to sort through, making it easy to make mistakes.

Maybe I'm missing something simple here, but how do people create new flashcards on a computer? I can easily edit and create new cards within Pleco on the iPod, but it is so time-consuming that it's counter-productive. I would think there has to be an easy and fast way to create new flashcards (and edit existing exported flashcards) on a computer, one that allows line breaks and other simple formatting.

Am I missing something?! As always, thanks.
 

mikelove

皇帝
Staff member
Hmm... could you email me (mikelove@pleco.com) your XML file and your older EAB1-using text file? Sounds like there might be some sort of bug here - you definitely should be able to insert line breaks using one of those methods at least.

I believe most people create new flashcards on their computer using a text editor, as you've been trying to do, so it's just a matter of figuring out why the formatting isn't working like it's supposed to.
 

jyh

秀才
Anything came out of that last exchange? Is it currently actually possible to format using either XML or private escape sequences? Or is this one of the changes on the flashcard system coming with with 2.3?

It's too late to request features for 2.3, but one that would solve most of my problems and would not break other people's flashcards (I Think) would be to allow in the text file one or more tab-separated fields for each flashcard.
 

mikelove

皇帝
Staff member
jyh said:
Anything came out of that last exchange? Is it currently actually possible to format using either XML or private escape sequences? Or is this one of the changes on the flashcard system coming with with 2.3?

Yes - it turned out there was an error in his particular files, but the private-use Unicode characters I mentioned do still seem to be working correctly if properly used. In XML you can insert them as entity codes;

Code:


for example would be a newline. It'll show up as an extra space or a random blank character in the text editor, but in an actual flashcard session you'll see the extra line. (hopefully we'll be able to use nice standard tags for this stuff in 2.3)

jyh said:
It's too late to request features for 2.3, but one that would solve most of my problems and would not break other people's flashcards (I Think) would be to allow in the text file one or more tab-separated fields for each flashcard.

Not necessarily too late, but I'm honestly not wild about that because I'd rather reserve additional tab columns for additional information (media file links, scores, etc) - if they turn into arbitrary numbers of extra fields then we lose the ability to do anything with any tab column past the third one, at least not without requiring people to add headers / go through extra import configuration steps / etc.
 

jyh

秀才
mikelove said:
Yes - it turned out there was an error in his particular files, but the private-use Unicode characters I mentioned do still seem to be working correctly if properly used. In XML you can insert them as entity codes;

Code:


for example would be a newline. It'll show up as an extra space or a random blank character in the text editor, but in an actual flashcard session you'll see the extra line. (hopefully we'll be able to use nice standard tags for this stuff in 2.3)

Thank you for the reply. I will have to try again. The last time I could not manage to make it work for me. I must have been doing something wrong.

mikelove said:
jyh said:
It's too late to request features for 2.3, but one that would solve most of my problems and would not break other people's flashcards (I Think) would be to allow in the text file one or more tab-separated fields for each flashcard.

Not necessarily too late, but I'm honestly not wild about that because I'd rather reserve additional tab columns for additional information (media file links, scores, etc) - if they turn into arbitrary numbers of extra fields then we lose the ability to do anything with any tab column past the third one, at least not without requiring people to add headers / go through extra import configuration steps / etc.

Oh I agree, but then this is going to be a problem with flat text files anyway. This is why I am eagerly waiting to see what the XML format is going to be like.
 

mikelove

皇帝
Staff member
jyh said:
Oh I agree, but then this is going to be a problem with flat text files anyway. This is why I am eagerly waiting to see what the XML format is going to be like.

What do you mean? It already exists, though it's not well documented yet and it needs some more fields - you can export a file in it from the "Export Cards" command.
 

jyh

秀才
mikelove said:
jyh said:
Oh I agree, but then this is going to be a problem with flat text files anyway. This is why I am eagerly waiting to see what the XML format is going to be like.

What do you mean? It already exists, though it's not well documented yet and it needs some more fields - you can export a file in it from the "Export Cards" command.
What I meant is "I can't wait to see the documentation about the XML format (some documentation, any partial documentation), so that I can get an idea of what can be achieved with XML in terms of formatting."
I have seen that I can export flashcards to XML format but until I see a list of the XML tags supported, this feature is not really useful to me at this point. I can only replicate what I see in the exported XML, and since the cards I can format within Pleco are not formatted the way I want, I obviously can't export XML with the tags I'd want. It's a bit of a chicken and egg problem.
 

mikelove

皇帝
Staff member
jyh said:
What I meant is "I can't wait to see the documentation about the XML format (some documentation, any partial documentation), so that I can get an idea of what can be achieved with XML in terms of formatting."

Ah, yes. There actually isn't a single formatting tag in our format at the moment, we still have to add some - the best way to import formatted cards right now is with that private-use character trick, which will work pretty much the same for XML or text imports.
 

Yug

秀才
@JYH:
I am trying to use Pleco to make flashcard for the Heisig book,
I'm looking for this flashcard since it is not available in my country but seems a nice method, did you provided this flashcard set ? where ?
 

jyh

秀才
Yug said:
@JYH:
I am trying to use Pleco to make flashcard for the Heisig book,
I'm looking for this flashcard since it is not available in my country but seems a nice method, did you provided this flashcard set ? where ?

I have not completed the flashcards for the Heisig book because I was blocked by formatting issue. To do the Heisig method properly you really need 3-sided cards. 1 side would be the character, one would be the "key word" Heisig associates to the character, and the third side would be be the mnemonic story/sentence each user would have to build for the character. So, in a sense it's not possible to build a set of Heisig flashcards that someone else could use directly because the stories would not make sense to them. The 3 sides are needed because you start learning by going from "key word" to character, possibly with the "story" as a hint/cheat.

Another thing is that even if there was a way to add a third side to Pleco cards, "strict Heisig" flashcards are not feasible with Pleco because Pleco (as far as I can tell) always includes the pinyin pronunciation of characters (and irritatingly, even inefficiently in my opinion, completely eschews phonetic primitives). Personally I thinks that it's a good thing, and the printed cards I made for myself do include pinyin. Still, it's something to keep in mind if you want to use Pleco for Heisig-style Hanzi learning.

So, if I manage to get 3-sided cards in Pleco, and also to get bold/italics formatting, I can produce a set of cards for the first book (again, each user would still have to fill in their own "story" side of the card), but frankly this is not a super-high priority job for me right now.
 

jyh

秀才
I forgot to say in my previous post...

Another thing to keep in mind is that some of the "primitives" used by Heisig in the Hanzi book are not characters proper. This is not a problem when producing paper-based cards because it's always possible to do a bit of cropping/masking in a graphic editor, but Pleco flashcard can't include such edited graphics. This means that if you want to produce a card for, say, Heisig's "top hat" primitive (the radical in 亢), you're out of luck. Some of the Heisig "primitives" coincide with characters and can be produced by Apple's Chinese fonts, but this is generally not the case.
 

mikelove

皇帝
Staff member
jyh said:
Another thing is that even if there was a way to add a third side to Pleco cards, "strict Heisig" flashcards are not feasible with Pleco because Pleco (as far as I can tell) always includes the pinyin pronunciation of characters (and irritatingly, even inefficiently in my opinion, completely eschews phonetic primitives).

Pinyin is automatically included for dictionary-linked cards, but you can easily skip it for customized ones. Could you explain your comment about "phonetic primitives"? I was under the impression that Heisig for Chinese rather explicitly avoided doing anything with pronunciation (it's only the Japanese title that uses pronunciation) - was that comment about Pleco or about Heisig?

jyh said:
The 3 sides are needed because you start learning by going from "key word" to character, possibly with the "story" as a hint/cheat.

That'll be possible in Pleco as soon as we add support for inserting arbitrary text in the "Pinyin" field, which there's a very good chance might happen in 2.2.2 - not very much coding involved for that really.

jyh said:
Another thing to keep in mind is that some of the "primitives" used by Heisig in the Hanzi book are not characters proper. This is not a problem when producing paper-based cards because it's always possible to do a bit of cropping/masking in a graphic editor, but Pleco flashcard can't include such edited graphics. This means that if you want to produce a card for, say, Heisig's "top hat" primitive (the radical in 亢), you're out of luck. Some of the Heisig "primitives" coincide with characters and can be produced by Apple's Chinese fonts, but this is generally not the case.

We can actually reproduce pretty much any of those in Pleco using the same system we use for stroke order diagrams and rare characters now - a lot of primitives are included in the built-in fonts, including the "top hat" 亠, but with those that don't you can find and insert them by their code point just as with the formatting codes; here's how:

1) Look up a character containing that component.
2) Tap on it and bring up Character Info.
3) Go into the "Chars" tab and select "Components."
4) Tap on the component you want to insert into a custom flashcard.
5) Select the "Details" tab.
6) If it's not already listed, tap on "Add New Field" and select "Code Point."
7) The value under "Code Point" is the character code you want; insert a character with that code into your flashcard text file and it should be rendered by Pleco as that standalone component.
 

jyh

秀才
Thanks Mike, that's a lot of very useful information.

mikelove said:
Pinyin is automatically included for dictionary-linked cards, but you can easily skip it for customized ones. Could you explain your comment about "phonetic primitives"? I was under the impression that Heisig for Chinese rather explicitly avoided doing anything with pronunciation (it's only the Japanese title that uses pronunciation) - was that comment about Pleco or about Heisig?
No idea what happened here, it seems that I managed to delete a complete line of my text. I am pretty sure that what I had typed was something along the line of "Pleco (as far as I can tell) always includes the pinyin pronunciation of characters whereas Hanzi Heisig ignores pronunciation (and irritatingly, even inefficiently in my opinion, completely eschews phonetic primitives)." [in blue the text that I managed to accidentally delete before hitting the "submit" button. I think it makes more sense this way. :oops:

mikelove said:
jyh said:
The 3 sides are needed because you start learning by going from "key word" to character, possibly with the "story" as a hint/cheat.

That'll be possible in Pleco as soon as we add support for inserting arbitrary text in the "Pinyin" field, which there's a very good chance might happen in 2.2.2 - not very much coding involved for that really.

So this "arbitrary text" could/would include a sort of "page break" to force creation of a third or fourth side to the flashcard?

mikelove said:
jyh said:
Some of the Heisig "primitives" coincide with characters and can be produced by Apple's Chinese fonts, but this is generally not the case.

We can actually reproduce pretty much any of those in Pleco using the same system we use for stroke order diagrams and rare characters now - a lot of primitives are included in the built-in fonts, including the "top hat" 亠, but with those that don't you can find and insert them by their code point just as with the formatting codes; here's how:

[detailed instructions follow]

That's really fantastic. I had no idea so much information was already available in Pleco. I guess this means I should start working again on my Heisig flashcards with what I already learned today, and I will add the third side "page break" (or whatever it is) when that feature becomes available in Pleco.
 

mikelove

皇帝
Staff member
jyh said:
No idea what happened here, it seems that I managed to delete a complete line of my text. I am pretty sure that what I had typed was something along the line of "Pleco (as far as I can tell) always includes the pinyin pronunciation of characters whereas Hanzi Heisig ignores pronunciation (and irritatingly, even inefficiently in my opinion, completely eschews phonetic primitives)."

Ah, that makes more sense - sorry for the mix-up.

jyh said:
So this "arbitrary text" could/would include a sort of "page break" to force creation of a third or fourth side to the flashcard?

It would basically just let you put something other than Pinyin in the Pinyin field; since you can configure Pleco to reveal any combination of the character / pinyin / definition fields, and reveal them separately, you'd simply create a flashcard list with the format:

character<tab>@Heisig keyword<tab>Heisig mnemonic

jyh said:
That's really fantastic. I had no idea so much information was already available in Pleco. I guess this means I should start working again on my Heisig flashcards with what I already learned today, and I will add the third side "page break" (or whatever it is) when that feature becomes available in Pleco.

I've been going back and forth about whether or not to approach UH Press (which publishes Heisig) or Tuttle (which publishes Matthews' "Learning Chinese Characters") about licensing one of these character mnemonic books officially - we already have relationships with both publishers. LCC however is challenging to present in Pleco because of all of the embedded images (though that's something we need to work on anyway), and Heisig seems rather controversial in general.
 
Top