mirror of
https://github.com/mii443/akaza.git
synced 2025-12-03 11:08:29 +00:00
change directory structure for better DX
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ dist/
|
|||||||
perf.data
|
perf.data
|
||||||
callgrind.*
|
callgrind.*
|
||||||
target/
|
target/
|
||||||
|
/.idea/
|
||||||
|
|||||||
0
akaza-core/Cargo.lock → Cargo.lock
generated
0
akaza-core/Cargo.lock → Cargo.lock
generated
1
akaza-core/.gitignore
vendored
1
akaza-core/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/.idea/
|
|
||||||
1
akaza-core/ibus-akaza/.gitignore
vendored
1
akaza-core/ibus-akaza/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/akaza.xml
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
Current status: WIP!
|
|
||||||
|
|
||||||
## Debugging
|
|
||||||
|
|
||||||
cargo build
|
|
||||||
pkill -f ibus-akaza
|
|
||||||
ibus engine akaza
|
|
||||||
|
|
||||||
if you want to debug `ibus-akaza`, you can use ibus-akaza-debug.sh.
|
|
||||||
Rewrite /usr/ibus/components/akaza.xml and set path to ibus-akaza.
|
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@ System dictionary/language model package for Akaza.
|
|||||||
|
|
||||||
## How to build this?
|
## How to build this?
|
||||||
|
|
||||||
cargo install --path ../akaza-core/bin/akaza-make-binary-dict
|
cargo install --path ../bin/akaza-make-binary-dict
|
||||||
cargo install --path ../akaza-core/bin/akaza-make-system-lm
|
cargo install --path ../bin/akaza-make-system-lm
|
||||||
make
|
make
|
||||||
|
|
||||||
## PyPI's size limit
|
## PyPI's size limit
|
||||||
|
|||||||
3
ibus-akaza/.gitignore
vendored
Normal file
3
ibus-akaza/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/akaza.xml
|
||||||
|
/akaza-debug.xml
|
||||||
|
|
||||||
@@ -13,17 +13,23 @@ all: akaza.xml
|
|||||||
|
|
||||||
akaza.xml: akaza.xml.in
|
akaza.xml: akaza.xml.in
|
||||||
sed \
|
sed \
|
||||||
-e "s:@DATADIR@:$(DATADIR):g" $< > $@
|
-e "s:@BINARY@:$(PREFIX)/bin/ibus-akaza:g" \
|
||||||
|
-e "s:@DATADIR@:$(DATADIR)/ibus-akaza/:g" $< > $@
|
||||||
|
|
||||||
|
akaza-debug.xml: akaza.xml.in
|
||||||
|
sed \
|
||||||
|
-e "s:@BINARY@:${PWD}/ibus-akaza-debug.sh:g" \
|
||||||
|
-e "s:@DATADIR@:$(DATADIR)/ibus-akaza/:g" $< > $@
|
||||||
|
|
||||||
install: ibus_akaza/config.py akaza.xml po/ja.mo
|
install: akaza.xml
|
||||||
cargo install
|
cargo install --path=. --root=$(PREFIX)
|
||||||
install -m 0755 -d $(DESTDIR)$(DATADIR)/ibus-akaza/ibus_akaza $(DESTDIR)$(SYSCONFDIR)/xdg/akaza $(DESTDIR)$(DATADIR)/ibus/component
|
|
||||||
install -m 0755 -d $(DESTDIR)$(DATADIR)/locale
|
|
||||||
|
|
||||||
install -m 0644 akaza.svg $(DESTDIR)$(DATADIR)/ibus-akaza
|
install -m 0644 akaza.svg $(DESTDIR)$(DATADIR)/ibus-akaza
|
||||||
install -m 0644 akaza.xml $(DESTDIR)$(DATADIR)/ibus/component
|
install -m 0644 akaza.xml $(DESTDIR)$(DATADIR)/ibus/component
|
||||||
|
|
||||||
|
install-debug: akaza-debug.xml
|
||||||
|
install -m 0644 akaza-debug.xml $(DESTDIR)$(DATADIR)/ibus/component/akaza.xml
|
||||||
|
|
||||||
test:
|
test:
|
||||||
cargo test
|
cargo test
|
||||||
|
|
||||||
@@ -33,5 +39,5 @@ uninstall:
|
|||||||
clean:
|
clean:
|
||||||
rm -f akaza.xml
|
rm -f akaza.xml
|
||||||
|
|
||||||
.PHONY: all test install uninstall clean
|
.PHONY: all test install uninstall clean install-debug
|
||||||
|
|
||||||
16
ibus-akaza/README.md
Normal file
16
ibus-akaza/README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# ibus-akaza
|
||||||
|
|
||||||
|
akaza の ibus binding です。
|
||||||
|
|
||||||
|
開発状態: 一応動きますが、まだ未実装の機能があります。
|
||||||
|
|
||||||
|
## install
|
||||||
|
|
||||||
|
`make && sudo make install` してください。
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
`sudo make install-debug` とすると、`../target/debug/ibus-akaza` を利用して起動するように `/usr/share/ibus/component/akaza.xml` が設定されます。
|
||||||
|
|
||||||
|
この状態で `./debug.sh` すると、ibus が再起動されて、ログファイルが表示されるようになります。
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -7,7 +7,7 @@
|
|||||||
<license>GPL</license>
|
<license>GPL</license>
|
||||||
<author>Tokuhiro Matsuno <tokuhirom@gmail.com></author>
|
<author>Tokuhiro Matsuno <tokuhirom@gmail.com></author>
|
||||||
<homepage>https://github.com/tokuhirom/ibus-akaza</homepage>
|
<homepage>https://github.com/tokuhirom/ibus-akaza</homepage>
|
||||||
<exec>@DATADIR@/ --ibus</exec>
|
<exec>@BINARY@ --ibus</exec>
|
||||||
<textdomain>ibus-akaza</textdomain>
|
<textdomain>ibus-akaza</textdomain>
|
||||||
<engines>
|
<engines>
|
||||||
<engine>
|
<engine>
|
||||||
9
ibus-akaza/py-ibus-akaza/README.md
Normal file
9
ibus-akaza/py-ibus-akaza/README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
python 時代のコード。
|
||||||
|
|
||||||
|
akaza の実装は以下のように変遷を辿っている
|
||||||
|
|
||||||
|
1. full python
|
||||||
|
2. UI:python, Logic:C++
|
||||||
|
3. full Rust
|
||||||
|
|
||||||
|
現在は full rust になっているがUIまわりについては、Python時代にはあったが rust に未移植のものがあるため、参考のためにこのディレクトリに残している。
|
||||||
@@ -64,7 +64,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_skkdict() -> anyhow::Result<()> {
|
fn test_skkdict() -> anyhow::Result<()> {
|
||||||
let dictpath =
|
let dictpath =
|
||||||
env!("CARGO_MANIFEST_DIR").to_string() + "/../../akaza-data/dict/SKK-JISYO.akaza";
|
env!("CARGO_MANIFEST_DIR").to_string() + "/../akaza-data/dict/SKK-JISYO.akaza";
|
||||||
let file = File::open(&dictpath).with_context(|| format!("path={}", &dictpath))?;
|
let file = File::open(&dictpath).with_context(|| format!("path={}", &dictpath))?;
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
BufReader::new(file).read_to_string(&mut buf)?;
|
BufReader::new(file).read_to_string(&mut buf)?;
|
||||||
@@ -10,7 +10,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn datadir() -> String {
|
fn datadir() -> String {
|
||||||
basedir() + "/../../akaza-data/data/"
|
basedir() + "/../akaza-data/data/"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_unigram() -> SystemUnigramLM {
|
fn load_unigram() -> SystemUnigramLM {
|
||||||
@@ -7,7 +7,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn datadir() -> String {
|
fn datadir() -> String {
|
||||||
basedir() + "/../../akaza-data/data/"
|
basedir() + "/../akaza-data/data/"
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -8,7 +8,7 @@ mod tests {
|
|||||||
use libakaza::graph::graph_resolver::Candidate;
|
use libakaza::graph::graph_resolver::Candidate;
|
||||||
|
|
||||||
fn load_akaza() -> Result<Akaza> {
|
fn load_akaza() -> Result<Akaza> {
|
||||||
let datadir = env!("CARGO_MANIFEST_DIR").to_string() + "/../../akaza-data/data/";
|
let datadir = env!("CARGO_MANIFEST_DIR").to_string() + "/../akaza-data/data/";
|
||||||
AkazaBuilder::default()
|
AkazaBuilder::default()
|
||||||
.system_data_dir(datadir.as_str())
|
.system_data_dir(datadir.as_str())
|
||||||
.build()
|
.build()
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user