Add examples
This commit is contained in:
parent
fcabdb4ae4
commit
dd1eaf6b5e
|
@ -0,0 +1,19 @@
|
|||
import 'dart:convert' show jsonEncode;
|
||||
import 'package:unofficial_jisho_api/unofficial_jisho_api.dart';
|
||||
final jisho = JishoApi();
|
||||
|
||||
void main() async {
|
||||
await jisho.searchForExamples('日').then((result) {
|
||||
print('Jisho Uri: ' + result.uri);
|
||||
print('');
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
var example = result.results[i];
|
||||
print(example.kanji);
|
||||
print(example.kana);
|
||||
print(example.english);
|
||||
print(jsonEncode(example.pieces));
|
||||
print('');
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import 'dart:convert' show jsonEncode;
|
||||
import 'package:unofficial_jisho_api/unofficial_jisho_api.dart';
|
||||
final jisho = JishoApi();
|
||||
|
||||
void main() async {
|
||||
await jisho.searchForKanji('語').then((result) {
|
||||
print('Found: ' + result.found.toString());
|
||||
print('Taught in: ' + result.taughtIn);
|
||||
print('JLPT level: ' + result.jlptLevel);
|
||||
print('Newspaper frequency rank: ' + result.newspaperFrequencyRank.toString());
|
||||
print('Stroke count: ' + result.strokeCount.toString());
|
||||
print('Meaning: ' + result.meaning);
|
||||
print('Kunyomi: ' + jsonEncode(result.kunyomi));
|
||||
print('Kunyomi example: ' + jsonEncode(result.kunyomiExamples[0]));
|
||||
print('Onyomi: ' + jsonEncode(result.onyomi));
|
||||
print('Onyomi example: ' + jsonEncode(result.onyomiExamples[0]));
|
||||
print('Radical: ' + jsonEncode(result.radical));
|
||||
print('Parts: ' + jsonEncode(result.parts));
|
||||
print('Stroke order diagram: ' + result.strokeOrderDiagramUri);
|
||||
print('Stroke order SVG: ' + result.strokeOrderSvgUri);
|
||||
print('Stroke order GIF: ' + result.strokeOrderGifUri);
|
||||
print('Jisho Uri: ' + result.uri);
|
||||
});
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
import 'dart:convert';
|
||||
import 'package:unofficial_jisho_api/unofficial_jisho_api.dart';
|
||||
final jisho = JishoApi();
|
||||
final encoder = JsonEncoder.withIndent(' ');
|
||||
|
||||
void main() async {
|
||||
await jisho.scrapeForPhrase('谷').then((data) {
|
||||
print(encoder.convert(data));
|
||||
});
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
import 'package:unofficial_jisho_api/unofficial_jisho_api.dart';
|
||||
|
||||
void main() {
|
||||
}
|
Loading…
Reference in New Issue