jadb/bin/kanjidic/objects.dart

285 lines
6.0 KiB
Dart
Raw Permalink Normal View History

2022-06-20 20:06:07 +02:00
import '../objects.dart';
class TableNames {
static const String character = 'KANJIDIC_Character';
static const String radicalName = 'KANJIDIC_RadicalName';
static const String codepoint = 'KANJIDIC_Codepoint';
static const String radical = 'KANJIDIC_Radical';
static const String strokeMiscount = 'KANJIDIC_StrokeMiscount';
static const String variant = 'KANJIDIC_Variant';
static const String dictionaryReference = '_KANJIDIC_DictionaryReference_Part1';
static const String dictionaryReferenceMoro = '_KANJIDIC_DictionaryReference_Moro';
static const String queryCode = 'KANJIDIC_QueryCode';
static const String reading = 'KANJIDIC_Reading';
static const String kunyomi = 'KANJIDIC_Kunyomi';
static const String onyomi = 'KANJIDIC_Onyomi';
static const String meaning = 'KANJIDIC_Meaning';
static const String nanori = 'KANJIDIC_Nanori';
}
class CodePoint extends SQLWritable {
final String kanji;
final String type;
final String codepoint;
const CodePoint({
required this.kanji,
required this.type,
required this.codepoint,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'type': type,
'codepoint': codepoint,
};
}
class Radical extends SQLWritable {
final String kanji;
final String type;
final String radical;
const Radical({
required this.kanji,
required this.type,
required this.radical,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'type': type,
'radical': radical,
};
}
class StrokeMiscount extends SQLWritable {
final String kanji;
final int strokeCount;
const StrokeMiscount({
required this.kanji,
required this.strokeCount,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'strokeCount': strokeCount,
};
}
class Variant extends SQLWritable {
final String kanji;
final String type;
final String variant;
const Variant({
required this.kanji,
required this.type,
required this.variant,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'type': type,
'variant': variant,
};
}
class DictionaryReference extends SQLWritable {
final String kanji;
final String type;
final String ref;
const DictionaryReference({
required this.kanji,
required this.type,
required this.ref,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'type': type,
'ref': ref,
};
}
class DictionaryReferenceMoro extends SQLWritable {
final String kanji;
final String ref;
final int? volume;
final int? page;
const DictionaryReferenceMoro({
required this.kanji,
required this.ref,
required this.volume,
required this.page,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'ref': ref,
'volume': volume,
'page': page,
};
}
class QueryCode extends SQLWritable {
final String kanji;
final String code;
final String type;
final String? skipMisclassification;
const QueryCode({
required this.kanji,
required this.code,
required this.type,
required this.skipMisclassification,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'code': code,
'type': type,
'skipMisclassification': skipMisclassification,
};
}
class Reading extends SQLWritable {
final String kanji;
final String type;
final String reading;
const Reading({
required this.kanji,
required this.type,
required this.reading,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'type': type,
'reading': reading,
};
}
class Kunyomi extends SQLWritable {
final String kanji;
final String yomi;
final bool isJouyou;
const Kunyomi({
required this.kanji,
required this.yomi,
required this.isJouyou,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'yomi': yomi,
'isJouyou': isJouyou,
};
}
class Onyomi extends SQLWritable {
final String kanji;
final String yomi;
final bool isJouyou;
final String? type;
const Onyomi({
required this.kanji,
required this.yomi,
required this.isJouyou,
required this.type,
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'yomi': yomi,
'isJouyou': isJouyou,
'type': type,
};
}
class Meaning extends SQLWritable {
final String kanji;
final String language;
final String meaning;
const Meaning({
required this.kanji,
required this.language,
this.meaning = 'eng',
});
@override
Map<String, Object?> get sqlValue => {
'kanji': kanji,
'language': language,
'meaning': meaning,
};
}
class Character extends SQLWritable {
final String literal;
final int strokeCount;
final int? grade;
final int? frequency;
final int? jlpt;
final List<String> radicalName;
final List<CodePoint> codepoints;
final List<Radical> radicals;
final List<int> strokeMiscounts;
final List<Variant> variants;
final List<DictionaryReference> dictionaryReferences;
final List<DictionaryReferenceMoro> dictionaryReferencesMoro;
final List<QueryCode> querycodes;
final List<Reading> readings;
final List<Onyomi> onyomi;
final List<Kunyomi> kunyomi;
final List<Meaning> meanings;
final List<String> nanori;
const Character({
required this.literal,
required this.strokeCount,
this.grade,
this.frequency,
this.jlpt,
this.radicalName = const [],
this.codepoints = const [],
this.radicals = const [],
this.strokeMiscounts = const [],
this.variants = const [],
this.dictionaryReferences = const [],
this.dictionaryReferencesMoro = const [],
this.querycodes = const [],
this.readings = const [],
this.onyomi = const [],
this.kunyomi = const [],
this.meanings = const [],
this.nanori = const [],
});
Map<String, Object?> get sqlValue => {
'literal': literal,
'grade': grade,
'strokeCount': strokeCount,
'frequency': frequency,
'jlpt': jlpt,
};
}