Add KANJIDIC source
This commit is contained in:
parent
9360695883
commit
83e216e401
|
@ -15,6 +15,6 @@ Future<void> main(List<String> arguments) async {
|
||||||
.openDatabase(Directory.current.uri.resolve('main.db').path);
|
.openDatabase(Directory.current.uri.resolve('main.db').path);
|
||||||
await addDataFromJMdict(db);
|
await addDataFromJMdict(db);
|
||||||
await addDataFromRADKFILE(db);
|
await addDataFromRADKFILE(db);
|
||||||
// await addDataFromKANJIDIC(db);
|
await addDataFromKANJIDIC(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
flake.lock
13
flake.lock
|
@ -24,6 +24,18 @@
|
||||||
"url": "http://ftp.edrdg.org/pub/Nihongo/JMdict_e_examp.gz"
|
"url": "http://ftp.edrdg.org/pub/Nihongo/JMdict_e_examp.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"KANJIDIC2Src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"narHash": "sha256-BaVQaAEisPC60ohz8Gyr5r0Fe4Qrjupj6VKQqMvq9Eo=",
|
||||||
|
"type": "file",
|
||||||
|
"url": "http://nihongo.monash.edu/kanjidic2/kanjidic2.xml.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "file",
|
||||||
|
"url": "http://nihongo.monash.edu/kanjidic2/kanjidic2.xml.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"RADKFILESrc": {
|
"RADKFILESrc": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -110,6 +122,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"JMdictSrc": "JMdictSrc",
|
"JMdictSrc": "JMdictSrc",
|
||||||
"JMdictWithExamplesSrc": "JMdictWithExamplesSrc",
|
"JMdictWithExamplesSrc": "JMdictWithExamplesSrc",
|
||||||
|
"KANJIDIC2Src": "KANJIDIC2Src",
|
||||||
"RADKFILESrc": "RADKFILESrc",
|
"RADKFILESrc": "RADKFILESrc",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nix-dart": "nix-dart",
|
"nix-dart": "nix-dart",
|
||||||
|
|
38
flake.nix
38
flake.nix
|
@ -32,6 +32,11 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
KANJIDIC2Src = {
|
||||||
|
url = "http://nihongo.monash.edu/kanjidic2/kanjidic2.xml.gz";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
@ -41,7 +46,8 @@
|
||||||
nix-dart,
|
nix-dart,
|
||||||
JMdictSrc,
|
JMdictSrc,
|
||||||
JMdictWithExamplesSrc,
|
JMdictWithExamplesSrc,
|
||||||
RADKFILESrc
|
RADKFILESrc,
|
||||||
|
KANJIDIC2Src
|
||||||
}: let
|
}: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
|
@ -95,9 +101,9 @@
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
gzip -dkc ${JMdictSrc} > JMdict.xml
|
gzip -dkc ${JMdictSrc} > JMdict.xml
|
||||||
gzip -dkc ${JMdictWithExamplesSrc} > JMdict_with_examples.xml
|
gzip -dkc ${JMdictWithExamplesSrc} > JMdict_with_examples.xml
|
||||||
xmlformat -i JMdict.xml
|
|
||||||
xmlformat -i JMdict_with_examples.xml
|
|
||||||
'';
|
'';
|
||||||
|
# xmlformat -i JMdict.xml
|
||||||
|
# xmlformat -i JMdict_with_examples.xml
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
|
@ -133,11 +139,34 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
KANJIDIC2 = mkDerivation {
|
||||||
|
name = "KANJIDIC2";
|
||||||
|
|
||||||
|
src = KANJIDIC2Src;
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [ xmlformat ];
|
||||||
|
buildPhase = ''
|
||||||
|
gzip -dkc ${KANJIDIC2Src} > kanjidic2.xml
|
||||||
|
'';
|
||||||
|
# xmlformat -i kanjidic2.xml
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp kanjidic2.xml $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = edrdgMetadata // {
|
||||||
|
# description = "A Japanese-Multilingual Dictionary providing lexical data for japanese words";
|
||||||
|
# homepage = "https://www.edrdg.org/jmdict/j_jmdict.html";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
database_generator = let
|
database_generator = let
|
||||||
buildDartPackage = nix-dart.builders.${system}.buildDartPackage.override {
|
buildDartPackage = nix-dart.builders.${system}.buildDartPackage.override {
|
||||||
dart = nix-dart.packages.${system}.dart-dev;
|
dart = nix-dart.packages.${system}.dart-dev;
|
||||||
};
|
};
|
||||||
in buildDartPackage {
|
in (buildDartPackage {
|
||||||
pname = "database_generator";
|
pname = "database_generator";
|
||||||
version = "1.0";
|
version = "1.0";
|
||||||
|
|
||||||
|
@ -166,6 +195,7 @@
|
||||||
mkdir -p data
|
mkdir -p data
|
||||||
ln -s ${self.packages.${system}.JMdict}/* data
|
ln -s ${self.packages.${system}.JMdict}/* data
|
||||||
ln -s ${self.packages.${system}.RADKFILE}/* data
|
ln -s ${self.packages.${system}.RADKFILE}/* data
|
||||||
|
ln -s ${self.packages.${system}.KANJIDIC2}/* data
|
||||||
|
|
||||||
sqlite3 ${dbName} < migrations/0001_initial.sql
|
sqlite3 ${dbName} < migrations/0001_initial.sql
|
||||||
sqlite3 ${dbName} < migrations/0002_insert_info_values.sql
|
sqlite3 ${dbName} < migrations/0002_insert_info_values.sql
|
||||||
|
|
22
pub2nix.lock
22
pub2nix.lock
|
@ -13,8 +13,8 @@ packages:
|
||||||
name: ffi
|
name: ffi
|
||||||
url: https://pub.dartlang.org
|
url: https://pub.dartlang.org
|
||||||
source: hosted
|
source: hosted
|
||||||
version: 1.1.2
|
version: 1.2.1
|
||||||
sha256: 0w0yd43y1fsfzihd4j6diymg90bgvyi2zqyb3vf0k6g8hk8x1yr6
|
sha256: 0dcivi3fk4kig3adkgrfc6nfkmx5x471x947ndwzv4rds4vahfq5
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -37,16 +37,16 @@ packages:
|
||||||
name: meta
|
name: meta
|
||||||
url: https://pub.dartlang.org
|
url: https://pub.dartlang.org
|
||||||
source: hosted
|
source: hosted
|
||||||
version: 1.7.0
|
version: 1.8.0
|
||||||
sha256: 1z8sx23l9jn2ickq3z63pqpb6k9y6gbnnvj9200c6v7m3cvd7jbv
|
sha256: 01kqdd25nln5a219pr94s66p27m0kpqz0wpmwnm24kdy3ngif1v5
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: https://pub.dartlang.org
|
url: https://pub.dartlang.org
|
||||||
source: hosted
|
source: hosted
|
||||||
version: 1.8.1
|
version: 1.8.2
|
||||||
sha256: 0wg5da3zykfbala8mvcl7r7blgi5qjb838qhw30brgj3ani2hdph
|
sha256: 16ggdh29ciy7h8sdshhwmxn6dd12sfbykf2j82c56iwhhlljq181
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -69,8 +69,8 @@ packages:
|
||||||
name: sqflite_common_ffi
|
name: sqflite_common_ffi
|
||||||
url: https://pub.dartlang.org
|
url: https://pub.dartlang.org
|
||||||
source: hosted
|
source: hosted
|
||||||
version: 2.1.1
|
version: 2.1.1+1
|
||||||
sha256: 0v5xq9xpg63zidf8as17zh0pbhfzf9k00a2wn183jz9i5rmh6207
|
sha256: 00h6mi8m76kh48hilvz3gw0i01fy37vcgxfjc0jbyhzrxbx4paal
|
||||||
sqlite3:
|
sqlite3:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -93,7 +93,7 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: https://pub.dartlang.org
|
url: https://pub.dartlang.org
|
||||||
source: hosted
|
source: hosted
|
||||||
version: 6.0.1
|
version: 6.1.0
|
||||||
sha256: 158srisyld2zwhchcz264rf8qnby54xan4db14hf7lda7bx8ikbh
|
sha256: 1pinq9zagchh2pk9d3ja3g8rljb3sl31qz2gw7djij7ih0dswxal
|
||||||
sdks:
|
sdks:
|
||||||
dart: '>=2.16.1 <3.0.0'
|
dart: '>=2.17.0 <3.0.0'
|
||||||
|
|
12
pubspec.lock
12
pubspec.lock
|
@ -14,7 +14,7 @@ packages:
|
||||||
name: ffi
|
name: ffi
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.2.1"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -35,14 +35,14 @@ packages:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.8.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.8.2"
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -63,7 +63,7 @@ packages:
|
||||||
name: sqflite_common_ffi
|
name: sqflite_common_ffi
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.1+1"
|
||||||
sqlite3:
|
sqlite3:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -84,6 +84,6 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.1"
|
version: "6.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.16.1 <3.0.0"
|
dart: ">=2.17.0 <3.0.0"
|
||||||
|
|
|
@ -9,7 +9,7 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
collection: ^1.16.0
|
collection: ^1.16.0
|
||||||
sqflite_common_ffi: ^2.1.1
|
sqflite_common_ffi: ^2.1.1
|
||||||
xml: ^6.0.1
|
xml: ^6.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
lints: ^1.0.0
|
lints: ^1.0.0
|
||||||
|
|
Loading…
Reference in New Issue