Skip to content

Commit

Permalink
upgrade marisa-trie to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
dongyuwei committed Feb 15, 2021
1 parent ac60625 commit 6e26010
Show file tree
Hide file tree
Showing 17 changed files with 170 additions and 91 deletions.
8 changes: 5 additions & 3 deletions README-En.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ hallelujahIM is an english input method with auto-suggestions and spell check fe
6. Fuzzy phonetic match. For example, you can input `cerrage` or `kerrage` to get `courage`, and you can input `aosome` or `ausome` to get `awesome`.
7. You can swith to the default English input mode(the normal||quiet||silent mode) by pressing the shift key. Pressing shift again, it will switch to the auto-suggestion mode.


# download and install

1. download releases
Expand Down Expand Up @@ -89,15 +88,18 @@ GPL3(GNU GENERAL PUBLIC LICENSE Version 3)

## About libmarisa / marisa-trie

1. the static `libmarisa.a` lib was built from [marisa-trie](https://github.com/s-yata/marisa-trie) @`59e410597981475bae94d9d9eb252c1d9790dc2f`
2. to build the `libmarisa.a` lib, run:
1. The static `libmarisa.a` lib was built from [marisa-trie](https://github.com/s-yata/marisa-trie) @`006020c1df76d0d7dc6118dacc22da64da2e35c4`.
2. To build the `libmarisa.a` lib, run:

```bash
git clone git://github.com/s-yata/marisa-trie.git
cd marisa-trie
brew install autoconf automake libtool -verbose
autoreconf -i
./configure --enable-static
make
## ls -alh lib/marisa/.libs/libmarisa.a
make install ## we can use marisa-build marisa-lookup marisa-reverse-lookup marisa-common-prefix-search marisa-predictive-search marisa-dump marisa-benchmark cli commands to do some tests and pre-build the trie data.
```

### Thanks to the following projects:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
主要是受这篇文章启发: [hallelujah_autocompletion](https://daringfireball.net/2006/10/hallelujah_autocompletion).

# 少数派网友(@北堂岚舞)测评

[英文拼写心里「没底」?这个输入法能把拼音补全为英文:哈利路亚输入法](https://sspai.com/post/56572)

# 偏好设置
Expand Down Expand Up @@ -79,7 +80,7 @@ GPL3(GNU GENERAL PUBLIC LICENSE Version 3)

## 构建 libmarisa.a

1. The static `libmarisa.a` lib was built from [marisa-trie](https://github.com/s-yata/marisa-trie) @`59e410597981475bae94d9d9eb252c1d9790dc2f`(the latest `006020c1df76d0d7dc6118dacc22da64da2e35c4` should also work. Todo: check && upgrade).
1. The static `libmarisa.a` lib was built from [marisa-trie](https://github.com/s-yata/marisa-trie) @`006020c1df76d0d7dc6118dacc22da64da2e35c4`.
2. To build the `libmarisa.a` lib, run:

```bash
Expand Down Expand Up @@ -115,6 +116,7 @@ make install ## we can use marisa-build marisa-lookup marisa-reverse-lookup mari
- gmail: newdongyuwei

### 一些截图

auto suggestion from local dictionary:<br/>
![auto-suggestion](https://github.com/dongyuwei/hallelujahIM/blob/master/snapshots/suggestions.png)
![auto-suggestion](https://github.com/dongyuwei/hallelujahIM/blob/master/snapshots/suggestions2.png)
Expand Down
5 changes: 5 additions & 0 deletions dictionary/build-binary-trie.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# marisa-build -t /usr/share/dict/web2 -o ./dict-test

marisa-build -b ./google_227800_words.txt -o ./google_227800_words.bin

# ls -alh lib/marisa/.libs/libmarisa.a
7 changes: 0 additions & 7 deletions dictionary/build-dict.sh

This file was deleted.

Binary file modified dictionary/google_227800_words.bin
Binary file not shown.
66 changes: 36 additions & 30 deletions include/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# include/Makefile. Generated from Makefile.in by configure.

# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -86,11 +86,14 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-apple-darwin16.3.0
host_triplet = x86_64-apple-darwin16.3.0
build_triplet = x86_64-apple-darwin20.2.0
host_triplet = x86_64-apple-darwin20.2.0
subdir = include
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
Expand Down Expand Up @@ -161,7 +164,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
Expand Down Expand Up @@ -209,13 +212,13 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = ${SHELL} /Users/dongyuwei/code/input-methods/marisa-trie/missing aclocal-1.15
ACLOCAL = ${SHELL} '/Users/yuwdong/code/mac/marisa-trie/missing' aclocal-1.16
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AR = ar
AUTOCONF = ${SHELL} /Users/dongyuwei/code/input-methods/marisa-trie/missing autoconf
AUTOHEADER = ${SHELL} /Users/dongyuwei/code/input-methods/marisa-trie/missing autoheader
AUTOMAKE = ${SHELL} /Users/dongyuwei/code/input-methods/marisa-trie/missing automake-1.15
AUTOCONF = ${SHELL} '/Users/yuwdong/code/mac/marisa-trie/missing' autoconf
AUTOHEADER = ${SHELL} '/Users/yuwdong/code/mac/marisa-trie/missing' autoheader
AUTOMAKE = ${SHELL} '/Users/yuwdong/code/mac/marisa-trie/missing' automake-1.16
AWK = awk
CC = gcc
CCDEPMODE = depmode=gcc3
Expand All @@ -227,7 +230,7 @@ CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DPACKAGE_NAME=\"marisa\" -DPACKAGE_TARNAME=\"marisa\" -DPACKAGE_VERSION=\"0.2.5\" -DPACKAGE_STRING=\"marisa\ 0.2.5\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"marisa\" -DVERSION=\"0.2.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"
DEFS = -DPACKAGE_NAME=\"marisa\" -DPACKAGE_TARNAME=\"marisa\" -DPACKAGE_VERSION=\"0.2.6\" -DPACKAGE_STRING=\"marisa\ 0.2.6\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"marisa\" -DVERSION=\"0.2.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"
DEPDIR = .deps
DLLTOOL = false
DSYMUTIL = dsymutil
Expand All @@ -239,12 +242,12 @@ EGREP = /usr/bin/grep -E
EXEEXT =
FGREP = /usr/bin/grep -F
GREP = /usr/bin/grep
INSTALL = /usr/local/bin/ginstall -c
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LD = /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LDFLAGS =
LIBOBJS =
LIBS =
Expand All @@ -253,9 +256,9 @@ LIPO = lipo
LN_S = ln -s
LTLIBOBJS =
LT_SYS_LIBRARY_PATH =
MAKEINFO = ${SHELL} /Users/dongyuwei/code/input-methods/marisa-trie/missing makeinfo
MAKEINFO = ${SHELL} '/Users/yuwdong/code/mac/marisa-trie/missing' makeinfo
MANIFEST_TOOL = :
MKDIR_P = /usr/local/bin/gmkdir -p
MKDIR_P = .././install-sh -c -d
NM = /usr/bin/nm -B
NMEDIT = nmedit
OBJDUMP = objdump
Expand All @@ -265,21 +268,21 @@ OTOOL64 = :
PACKAGE = marisa
PACKAGE_BUGREPORT = [email protected]
PACKAGE_NAME = marisa
PACKAGE_STRING = marisa 0.2.5
PACKAGE_STRING = marisa 0.2.6
PACKAGE_TARNAME = marisa
PACKAGE_URL =
PACKAGE_VERSION = 0.2.5
PACKAGE_VERSION = 0.2.6
PATH_SEPARATOR = :
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
VERSION = 0.2.5
abs_builddir = /Users/dongyuwei/code/input-methods/marisa-trie/include
abs_srcdir = /Users/dongyuwei/code/input-methods/marisa-trie/include
abs_top_builddir = /Users/dongyuwei/code/input-methods/marisa-trie
abs_top_srcdir = /Users/dongyuwei/code/input-methods/marisa-trie
VERSION = 0.2.6
abs_builddir = /Users/yuwdong/code/mac/marisa-trie/include
abs_srcdir = /Users/yuwdong/code/mac/marisa-trie/include
abs_top_builddir = /Users/yuwdong/code/mac/marisa-trie
abs_top_srcdir = /Users/yuwdong/code/mac/marisa-trie
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
Expand All @@ -290,26 +293,26 @@ am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
bindir = ${exec_prefix}/bin
build = x86_64-apple-darwin16.3.0
build = x86_64-apple-darwin20.2.0
build_alias =
build_cpu = x86_64
build_os = darwin16.3.0
build_os = darwin20.2.0
build_vendor = apple
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = x86_64-apple-darwin16.3.0
host = x86_64-apple-darwin20.2.0
host_alias =
host_cpu = x86_64
host_os = darwin16.3.0
host_os = darwin20.2.0
host_vendor = apple
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /Users/dongyuwei/code/input-methods/marisa-trie/install-sh
install_sh = ${SHELL} /Users/yuwdong/code/mac/marisa-trie/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
Expand Down Expand Up @@ -351,8 +354,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
Expand Down Expand Up @@ -490,7 +493,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am

distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
Expand Down
20 changes: 13 additions & 7 deletions include/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2020 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -90,7 +90,10 @@ build_triplet = @build@
host_triplet = @host@
subdir = include
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
Expand Down Expand Up @@ -161,7 +164,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
Expand Down Expand Up @@ -351,8 +354,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
Expand Down Expand Up @@ -490,7 +493,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am

distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
Expand Down
Loading

0 comments on commit 6e26010

Please sign in to comment.