mirror of
https://github.com/h7x4/unofficial_jisho_api_dart.git
synced 2025-10-06 04:53:58 +02:00
Fix some bugs
This commit is contained in:
@@ -96,12 +96,12 @@ class Radical {
|
||||
this.meaning = meaning;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
{
|
||||
'symbol': symbol,
|
||||
'forms': forms,
|
||||
'meaning': meaning
|
||||
};
|
||||
Map<String, dynamic> toJson() =>
|
||||
{
|
||||
if (symbol != null) 'symbol': symbol,
|
||||
if (forms != null) 'forms': forms,
|
||||
if (meaning != null) 'meaning': meaning
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -116,14 +116,42 @@ class KanjiResult {
|
||||
String meaning;
|
||||
List<String> kunyomi;
|
||||
List<String> onyomi;
|
||||
List<YomiExample> onyomiExamples;
|
||||
List<YomiExample> kunyomiExamples;
|
||||
List<YomiExample> onyomiExamples;
|
||||
Radical radical;
|
||||
List<String> parts;
|
||||
String strokeOrderDiagramUri;
|
||||
String strokeOrderSvgUri;
|
||||
String strokeOrderGifUri;
|
||||
String uri;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
|
||||
if (found == false) return {
|
||||
'query': query,
|
||||
'found': found
|
||||
};
|
||||
|
||||
return {
|
||||
'query': query,
|
||||
'found': found,
|
||||
'taughtIn': taughtIn,
|
||||
'jlptLevel': jlptLevel,
|
||||
'newspaperFrequencyRank': newspaperFrequencyRank.toString(),
|
||||
'strokeCount': strokeCount,
|
||||
'meaning': meaning,
|
||||
'kunyomi': kunyomi,
|
||||
'onyomi': onyomi,
|
||||
'onyomiExamples': onyomiExamples.map((onyomiExample) => onyomiExample.toJson()).toList(),
|
||||
'kunyomiExamples': kunyomiExamples.map((kunyomiExample) => kunyomiExample.toJson()).toList(),
|
||||
'radical': radical.toJson(),
|
||||
'parts': parts,
|
||||
'strokeOrderDiagramUri': strokeOrderDiagramUri,
|
||||
'strokeOrderSvgUri': strokeOrderSvgUri,
|
||||
'strokeOrderGifUri': strokeOrderGifUri,
|
||||
'uri': uri
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class ExampleSentencePiece {
|
||||
|
@@ -8,9 +8,9 @@ final htmlUnescape = html_entities.HtmlUnescape();
|
||||
|
||||
// TODO: Put public facing types in this file.
|
||||
|
||||
const String JISHO_API = 'https://jisho.org/api/v1/search/words';
|
||||
const String SCRAPE_BASE_URI = 'https://jisho.org/search/';
|
||||
const String STROKE_ORDER_DIAGRAM_BASE_URI = 'https://classic.jisho.org/static/images/stroke_diagrams/';
|
||||
const String JISHO_API = 'http://jisho.org/api/v1/search/words';
|
||||
const String SCRAPE_BASE_URI = 'http://jisho.org/search/';
|
||||
const String STROKE_ORDER_DIAGRAM_BASE_URI = 'http://classic.jisho.org/static/images/stroke_diagrams/';
|
||||
|
||||
/* KANJI SEARCH FUNCTIONS START */
|
||||
|
||||
|
Reference in New Issue
Block a user