Permalink
Browse files

Update Readme JS example to match new syntax

  • Loading branch information...
1 parent c12c8a2 commit ac1e27888fb1553366e181cb03f2ea86c6686696 @Kimtaro committed Nov 6, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 Readme.md
View
@@ -18,15 +18,16 @@ Ruby
Javascript
----------
- <script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="ve.js"></script>
<script type="text/javascript" charset="utf-8">
- Ve('ja').words('ビールがおいしかった', function(words) {
+ new Ve('ja').words('ビールがおいしかった', function(words) {
// [{"_class":"Word","word":"ビール","lemma":"ビール","part_of_speech":"noun","tokens":[{"raw":"ビール\t名詞,一般,*,*,*,*,ビール,ビール,ビール","type":"parsed","literal":"ビール","pos":"名詞","pos2":"一般","pos3":"*","pos4":"*","inflection_type":"*","inflection_form":"*","lemma":"ビール","reading":"ビール","hatsuon":"ビール","characters":"0..2"}],"extra":{"reading":"ビール","transcription":"ビール","grammar":null},"info":{"reading_script":"kata","transcription_script":"kata"}},{"_class":"Word","word":"が","lemma":"が","part_of_speech":"postposition","tokens":[{"raw":"が\t助詞,格助詞,一般,*,*,*,が,ガ,ガ","type":"parsed","literal":"が","pos":"助詞","pos2":"格助詞","pos3":"一般","pos4":"*","inflection_type":"*","inflection_form":"*","lemma":"が","reading":"ガ","hatsuon":"ガ","characters":"3..3"}],"extra":{"reading":"ガ","transcription":"ガ","grammar":null},"info":{"reading_script":"kata","transcription_script":"kata"}},{"_class":"Word","word":"おいしい","lemma":"おいしい","part_of_speech":"adjective","tokens":[{"raw":"おいしい\t形容詞,自立,*,*,形容詞・イ段,基本形,おいしい,オイシイ,オイシイ","type":"parsed","literal":"おいしい","pos":"形容詞","pos2":"自立","pos3":"*","pos4":"*","inflection_type":"形容詞・イ段","inflection_form":"基本形","lemma":"おいしい","reading":"オイシイ","hatsuon":"オイシイ","characters":"4..7"}],"extra":{"reading":"オイシイ","transcription":"オイシイ","grammar":null},"info":{"reading_script":"kata","transcription_script":"kata"}}]
- $.each(words, function(i,w) {
- console.log(w.lemma + "/" + w.part_of_speech)
- });
+ for ( i in words ) {
+ var word = words[i];
+ console.log(word.lemma + "/" + word.part_of_speech)
+ }
+
// ビール/noun
// が/postposition
// おいしい/adjective

0 comments on commit ac1e278

Please sign in to comment.