From 9f358ce23a7b5385e28a728516113681c6a1ae24 Mon Sep 17 00:00:00 2001 From: Itsuki Toyota Date: Sat, 10 Dec 2022 23:31:19 +0900 Subject: [PATCH 1/3] Use zef instead of cpan --- dist.ini | 2 ++ lib/MeCab.pm6 | 6 +++--- lib/MeCab/CustomBuilder.pm6 | 2 +- lib/MeCab/DictionaryInfo.pm6 | 2 +- lib/MeCab/Lattice.pm6 | 2 +- lib/MeCab/Model.pm6 | 2 +- lib/MeCab/Tagger.pm6 | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dist.ini b/dist.ini index 97b8759..4a7120e 100644 --- a/dist.ini +++ b/dist.ini @@ -8,6 +8,8 @@ name = raku-MeCab ; if you want to change a file that generates README.md, then: ; filename = lib/Your/Tutorial.pod +[UploadToZef] + [PruneFiles] ; if you want to prune files when packaging, then ; filename = utils/tool.pl diff --git a/lib/MeCab.pm6 b/lib/MeCab.pm6 index cc91e7a..e17778c 100644 --- a/lib/MeCab.pm6 +++ b/lib/MeCab.pm6 @@ -3,9 +3,9 @@ use NativeCall; my constant $library = %?RESOURCES.Str; -class MeCab:auth:ver<0.0.17> { } -class MeCab::Path:auth:ver<0.0.17> is repr('CStruct') { ... } -class MeCab::Node:auth:ver<0.0.17> is repr('CStruct') is export { +class MeCab:auth:ver<0.0.11> { } +class MeCab::Path:auth:ver<0.0.11> is repr('CStruct') { ... } +class MeCab::Node:auth:ver<0.0.11> is repr('CStruct') is export { enum Stat is export ( :MECAB_NOR_NODE(0), :MECAB_UNK_NODE(1), diff --git a/lib/MeCab/CustomBuilder.pm6 b/lib/MeCab/CustomBuilder.pm6 index 7f75185..1ca84fb 100644 --- a/lib/MeCab/CustomBuilder.pm6 +++ b/lib/MeCab/CustomBuilder.pm6 @@ -5,7 +5,7 @@ use Zef::Fetch; use Zef::Extract; use Distribution::Builder::MakeFromJSON; -class MeCab::CustomBuilder:ver<0.0.17> is Distribution::Builder::MakeFromJSON { +class MeCab::CustomBuilder:auth:ver<0.0.17> is Distribution::Builder::MakeFromJSON { method build(IO() $work-dir = $*CWD) { my $workdir = ~$work-dir; if $*DISTRO.is-win { diff --git a/lib/MeCab/DictionaryInfo.pm6 b/lib/MeCab/DictionaryInfo.pm6 index 120a3cf..259173e 100644 --- a/lib/MeCab/DictionaryInfo.pm6 +++ b/lib/MeCab/DictionaryInfo.pm6 @@ -1,5 +1,5 @@ use v6; -unit class MeCab::DictionaryInfo:auth:ver<0.0.17> is repr('CStruct'); +unit class MeCab::DictionaryInfo:auth:ver<0.0.17> is repr('CStruct'); enum DictionaryInfoType is export ( :MECAB_SYS_DIC(0), diff --git a/lib/MeCab/Lattice.pm6 b/lib/MeCab/Lattice.pm6 index f6f57b4..404d74a 100644 --- a/lib/MeCab/Lattice.pm6 +++ b/lib/MeCab/Lattice.pm6 @@ -1,7 +1,7 @@ use v6; use NativeCall; -unit class MeCab::Lattice:auth:ver<0.0.17> is repr('CPointer'); +unit class MeCab::Lattice:auth:ver<0.0.17> is repr('CPointer'); use MeCab; diff --git a/lib/MeCab/Model.pm6 b/lib/MeCab/Model.pm6 index d72d98c..3a08ddb 100644 --- a/lib/MeCab/Model.pm6 +++ b/lib/MeCab/Model.pm6 @@ -1,5 +1,5 @@ use v6; -unit class MeCab::Model:auth:ver<0.0.17> is repr('CPointer'); +unit class MeCab::Model:auth:ver<0.0.17> is repr('CPointer'); use NativeCall; use MeCab::Tagger; diff --git a/lib/MeCab/Tagger.pm6 b/lib/MeCab/Tagger.pm6 index 367f3f1..b876af2 100644 --- a/lib/MeCab/Tagger.pm6 +++ b/lib/MeCab/Tagger.pm6 @@ -1,5 +1,5 @@ use v6; -unit class MeCab::Tagger:auth:ver<0.0.17> is repr('CPointer'); +unit class MeCab::Tagger:auth:ver<0.0.17> is repr('CPointer'); use NativeCall; use MeCab; From 734a01d93fa2b781d2ff91210a65726889345d4d Mon Sep 17 00:00:00 2001 From: Itsuki Toyota Date: Sat, 10 Dec 2022 23:32:24 +0900 Subject: [PATCH 2/3] Tweak auth field --- META6.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META6.json b/META6.json index cd48972..08155cf 100644 --- a/META6.json +++ b/META6.json @@ -1,5 +1,5 @@ { - "auth": "titsuki", + "auth": "zef:titsuki", "authors": [ "Itsuki Toyota" ], From 6e9fd8549fc44ac14cadcbad07b24f117bfcb808 Mon Sep 17 00:00:00 2001 From: Itsuki Toyota Date: Sun, 11 Dec 2022 00:29:37 +0900 Subject: [PATCH 3/3] Fix Int to Bool cast --- README.md | 2 +- lib/MeCab/Lattice.pm6 | 4 ++-- lib/MeCab/Tagger.pm6 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cbbdff4..e5cab8c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Actions Status](https://github.com/titsuki/raku-MeCab/workflows/test/badge.svg)](https://github.com/titsuki/raku-MeCab/actions) +[![Build Status](https://travis-ci.org/titsuki/raku-MeCab.svg?branch=master)](https://travis-ci.org/titsuki/raku-MeCab) NAME ==== diff --git a/lib/MeCab/Lattice.pm6 b/lib/MeCab/Lattice.pm6 index 404d74a..c696b77 100644 --- a/lib/MeCab/Lattice.pm6 +++ b/lib/MeCab/Lattice.pm6 @@ -67,7 +67,7 @@ method clear { } method is-available returns Bool { - Bool(mecab_lattice_is_available(self)) + mecab_lattice_is_available(self) ?? True !! False } method bos-node { @@ -151,7 +151,7 @@ method nbest-tostr(Int $size) { } method has-constraint returns Bool { - Bool(mecab_lattice_has_constraint(self)) + mecab_lattice_has_constraint(self) ?? True !! False } multi method boundary-constraint(Int $pos) returns BoundaryConstraintType { diff --git a/lib/MeCab/Tagger.pm6 b/lib/MeCab/Tagger.pm6 index b876af2..707c2b9 100644 --- a/lib/MeCab/Tagger.pm6 +++ b/lib/MeCab/Tagger.pm6 @@ -70,7 +70,7 @@ multi method parse(Str $text) { } multi method parse(MeCab::Lattice $lattice) returns Bool { - Bool(mecab_parse_lattice(self, $lattice)) + mecab_parse_lattice(self, $lattice) ?? True !! False } method parse-tonode(Str $text) {