Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hasradical{"map":
- function(doc) {
- /* only deal with chars, not words */
- if (doc.type != 'meng_unihan') {return;}
- if (doc.frequency > 3) { return;}
- if (doc.strokes === null) {
- emit(doc.radical_id, {unicode:doc.codepoint, type:'radical'});
- } else {
- if (doc.radical_id)
- emit(doc.radical_id, {unicode:doc.codepoint, stk:doc.strokes, rstk:doc.strokes_r, radical_id: doc.radical_id, type:'char', pronounce:doc.pronounce});
- }
- }
- },
- otherpos {"map":
- function(doc) {
- /* only deal with words, not chars */
- if (doc.type != 'meng_word') {return;}
- hex = doc.as_utfhex.split('\\u');
- firstPassed = false
- for (x in hex) {
- if (hex[x].length > 2) {
- if (firstPassed)
- emit (hex[x], {hex: doc.as_utfhex, raw:doc.as_raw, meaning:doc.meaning});
- //only emit other chars
- firstPassed = true;
- }
- }
- }
- },
- firstpos {"map":
- function(doc) {
- /* only deal with words, not chars */
- if (doc.type != 'meng_word') {return;}
- hex = doc.as_utfhex.split('\\u');
- for (x in hex) {
- if (hex[x].length > 2) {
- emit (hex[x], {hex: doc.as_utfhex, raw:doc.as_raw, meaning:doc.meaning});
- //only emit the first char
- break;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment