Looks like the Great Firewall or something like it is preventing you from completely loading www.skritter.com because it is hosted on Google App Engine, which is periodically blocked. Try instead our mirror:

legacy.skritter.cn

This might also be caused by an internet filter, such as SafeEyes. If you have such a filter installed, try adding appspot.com to the list of allowed domains.

Changing the definitions export format

Dorayaki   November 22nd, 2011 1:19a.m.

Hi,

Below is a sample of a vocabulary list exported with Skritter (in French):

开 kāi ouvrir; s'épanouir; commencer; mettre en marche;
allumer [simplified]
開 kāi ouvrir; s'épanouir; commencer; mettre en marche;
allumer [traditional]
電影 diànyǐng cinéma; film [traditional]
电影 diànyǐng cinéma; film [simplified]

As you can see:
- lot of information is printed twice (simplified and traditional)
- since newlines can be embedded in definitions, it is very difficult to parse

How about exporting definitions in this format instead?
[traditional] [simplified] [pinyin] [definition]

fields would be separated by tabs, and each newline in definitions would be replaced by '\n' (litterally)

scott   November 22nd, 2011 9:38a.m.

The simplified/traditional issue is a bit complex to fix, because there are cases when the simplified and traditional definitions are not the same, namely when there are more than one traditional character for a single simplified one. Those would have to still be separate lines. I suppose they could be empty fields for those columns.

The newlines should be turned into \n though, yes. I'll get that fixed.

Catherine :)   November 22nd, 2011 2:07p.m.

What's the reasoning behind the new lines in definitions? It isn't really obvious and it took me a while to figure out, and I think in places it's a bit inconsistent. Could there be a system of "," and ";" rather than ";" and new lines?

nick   November 22nd, 2011 2:29p.m.

That's the system we just switched away from, after many complaints!

The newlines are there to help indicate which groups of meanings go with which readings, in the case of characters that have multiple readings.

In custom definitions, you can use newlines for whatever you want, but in standard Skritter English definitions, that's the plan. You can help fix inconsistencies by submitting definition corrections.

Dorayaki   November 22nd, 2011 4:39p.m.

Hi Scott, I'm not sure to get the case when there should have empty fields. IMHO as long as definitions are identified by the 3 values (simplified, traditional, pinyin), it works. As an example:

发 發 fā to send out
发 髮 fà hair

is easier to manipulate and more concise than

发 fā to send out\nhair [simplified]
發 fā to send out [traditional]
髮 fà hair [traditional]

PS: Thanks for the \n :)

Dennis   November 22nd, 2011 5:07p.m.

I'm confused. With which export is this happening?

Dorayaki   November 23rd, 2011 12:47a.m.

Dennis: "Export words" in http://www.skritter.com/vocab/list?list=47872248 for example

Dennis   November 23rd, 2011 9:30a.m.

Thanks,Sebastien

The reason I asked is because I don't see this behavior and wanted to make sure I checked all the exports. I'm doing traditional forms of the characters and only see traditional forms with the definitions on one line. Could this be why I don't see this happening or is there something I'm not doing?

I would switch to simplified forms to see what happens, but don't know if I can switch back without having made some permanent changes.

nick   November 23rd, 2011 11:00a.m.

We've only changed the newline thing for now, Dennis, on the beta site. Or maybe that's not up yet. We haven't combined the simplifieds into one line. And you only see the simplified forms that you are studying.

(You can switch to simplified, or both, and back without any real changes--just don't click on the button to reset your lists to the beginning when it asks you.)

Dorayaki   November 23rd, 2011 1:36p.m.

Dennis: I study both simplified and traditional, it may be the reason why I can see both in the export list

Dorayaki   November 23rd, 2011 2:46p.m.

Hi nick, don't know if perl is your friend or not, but just in case you can't wait (like me), the ugly command line below does the job of merging simplified and traditional into one single line:

perl -CSD -aF'\t' -ne 'unless (/^\s*(\/.*)?$/) { $h{$F[2]} = [ $F[0], $F[0], $F[1] ] unless exists $h{$F[2]}; $h{$F[2]}[$F[3] =~ /trad/] = $F[0]; } END { foreach (keys %h) { @a = @{$h{$_}}; print "$a[0]\t$a[1]\t$a[2]\t$_\n"; }}' hsk1.txt


I copy-pasted the hsk1 export into hsk1.txt, and it worked :)

Dennis   November 23rd, 2011 3:40p.m.

Nick,

Thanks for the clarification.

DependableSkeleton   December 4th, 2011 12:34p.m.

I really don't like the newlines in the definitions because it's never clear what's a hard newline, and what's a soft line wrap. Could you please either put a double newline (so that there's white space), or use "," and ";" (or something)?

nick   December 4th, 2011 5:14p.m.

Dependable Skeleton, are you talking about the newlines in the export, or displayed in the prompt while studying?

DependableSkeleton   December 4th, 2011 8:29p.m.

In the prompt while studying.

nick   December 5th, 2011 11:07a.m.

It's on our to-do list to try something like this.

DependableSkeleton   December 5th, 2011 12:50p.m.

Cool.

This forum is now read only. Please go to Skritter Discourse Forum instead to start a new conversation!