pax_global_header00006660000000000000000000000064123063657330014522gustar00rootroot0000000000000052 comment=fc425065e64d520694f47ddf8046e522d6dea96f cmigemo-1.2+gh0.20140306/000077500000000000000000000000001230636573300143545ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/.cvsignore000066400000000000000000000001201230636573300163450ustar00rootroot00000000000000*.exp *.lib *.map *.tds Profile build cmigemo libmigemo*dylib libmigemo.so* tmp cmigemo-1.2+gh0.20140306/.cvsrepository000066400000000000000000000000071230636573300173050ustar00rootroot00000000000000migemo cmigemo-1.2+gh0.20140306/Makefile000066400000000000000000000054251230636573300160220ustar00rootroot00000000000000# vi:set ts=8 sts=8 sw=8 tw=0: # # C/Migemo Makefile # # Last Change: 19-Oct-2003. # Maintainer: MURAOKA Taro default: tags tags: src/*.c src/*.h ctags src/*.c src/*.h ############################################################################## # for Borland C 5 # bc: bc-rel bc-all: bc-rel bc-dict bc-rel: $(MAKE) -f compile\Make_bc5.mak bc-dict: $(MAKE) -f compile\Make_bc5.mak dictionary bc-clean: $(MAKE) -f compile\Make_bc5.mak clean bc-distclean: $(MAKE) -f compile\Make_bc5.mak distclean ############################################################################## # for Cygwin # cyg: cyg-rel cyg-all: cyg-rel cyg-dict cyg-rel: $(MAKE) -f compile/Make_cyg.mak cyg-dict: $(MAKE) -f compile/Make_cyg.mak dictionary cyg-install: cyg-all $(MAKE) -f compile/Make_cyg.mak install cyg-uninstall: $(MAKE) -f compile/Make_cyg.mak uninstall cyg-clean: $(MAKE) -f compile/Make_cyg.mak clean cyg-distclean: $(MAKE) -f compile/Make_cyg.mak distclean ############################################################################## # for GNU/gcc (Linux and others) # (Tested on Vine Linux 2.1.5) # gcc: gcc-rel gcc-all: gcc-rel gcc-dict gcc-rel: $(MAKE) -f compile/Make_gcc.mak gcc-dict: $(MAKE) -f compile/Make_gcc.mak dictionary gcc-install: gcc-all $(MAKE) -f compile/Make_gcc.mak install gcc-uninstall: $(MAKE) -f compile/Make_gcc.mak uninstall gcc-clean: $(MAKE) -f compile/Make_gcc.mak clean gcc-distclean: $(MAKE) -f compile/Make_gcc.mak distclean ############################################################################## # for Microsoft Visual C # msvc: msvc-rel msvc-all: msvc-rel msvc-dict msvc-rel: $(MAKE) /nologo /f compile\Make_mvc.mak msvc-dict: $(MAKE) /nologo /f compile\Make_mvc.mak dictionary msvc-clean: $(MAKE) /nologo /f compile\Make_mvc.mak clean msvc-distclean: $(MAKE) /nologo /f compile\Make_mvc.mak distclean ############################################################################## # for MacOS X # osx: osx-rel osx-all: osx-rel osx-dict osx-rel: $(MAKE) -f compile/Make_osx.mak osx-dict: $(MAKE) -f compile/Make_osx.mak dictionary osx-install: osx-all $(MAKE) -f compile/Make_osx.mak install osx-uninstall: $(MAKE) -f compile/Make_osx.mak uninstall osx-clean: $(MAKE) -f compile/Make_osx.mak clean osx-distclean: $(MAKE) -f compile/Make_osx.mak distclean ############################################################################## # for Sun's Solaris/gcc # (Tested on Solaris 8) # sun: sun-rel sun-all: sun-rel sun-dict sun-rel: $(MAKE) -f compile/Make_sun.mak sun-dict: $(MAKE) -f compile/Make_sun.mak dictionary sun-install: sun-all $(MAKE) -f compile/Make_sun.mak install sun-uninstall: $(MAKE) -f compile/Make_sun.mak uninstall sun-clean: $(MAKE) -f compile/Make_sun.mak clean sun-distclean: $(MAKE) -f compile/Make_sun.mak distclean cmigemo-1.2+gh0.20140306/README.txt000066400000000000000000000002221230636573300160460ustar00rootroot00000000000000C/Migemo Library. README See doc/README_j.txt (Japanese). LICENSE See doc/LICENSE_j.txt (Japanese). TODO See doc/TODO_j.txt (Japanese). cmigemo-1.2+gh0.20140306/VERSION000066400000000000000000000000041230636573300154160ustar00rootroot000000000000001.2 cmigemo-1.2+gh0.20140306/compile/000077500000000000000000000000001230636573300160045ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/compile/Make_bc5.mak000066400000000000000000000026711230636573300201120ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Borland C 5用 Makefile # # Last Change: 19-Oct-2003. # Adviced By: MATSUMOTO Yasuhiro # Maintainer: MURAOKA Taro # 参考資料: # http://www2.justnet.ne.jp/~tyche/bcbbugs/bcc32-option.html # http://www2.justnet.ne.jp/~tyche/bcbbugs/ilink32-option.html default: rel !include config.mk !include compile\dos.mak !include src\depend.mak !include compile\clean_dos.mak !include compile\clean.mak !include dict\dict.mak libmigemo_LIB = $(outdir)migemo.lib libmigemo_DSO = $(outdir)migemo.dll libmigemo_SRC = $(SRC) libmigemo_OBJ = $(OBJ) DEFINES = -DWIN32 -D_CONSOLE CFLAGS = -O2 -G -pr -w- -VM -WM $(DEFINES) $(CFLAGS_MIGEMO) LDFLAGS = -x -Gn -w- $(LDFLAGS_MIGEMO) LIBS = import32.lib cw32mt.lib LD = ilink32 rel: dirs $(outdir)cmigemo.exe dirs: @for %i IN ($(outdir) $(objdir)) do if not exist %inul $(MKDIR) %i # Without the following, the implicit rule in BUILTINS.MAK is picked up # for a rule for .c.obj rather than the local implicit rule .SUFFIXES .SUFFIXES .c .obj {$(srcdir)}.c{$(objdir)}.$(O): $(CC) $(CFLAGS) -o$@ -c $< $(outdir)cmigemo.exe: $(libmigemo_LIB) $(objdir)main.obj $(LD) $(LDFLAGS) c0x32.obj $(objdir)main.obj, $@, , $(libmigemo_LIB) $(LIBS), , $(libmigemo_LIB): $(libmigemo_DSO) $(libmigemo_DSO): $(libmigemo_OBJ) $(srcdir)migemo.def $(LD) $(LDFLAGS) -Tpd -Gi $(libmigemo_OBJ) c0d32.obj, $@, , $(LIBS), $(srcdir)migemo.def, dictionary: cd-dict bc5 cd .. cd-dict: cd dict cmigemo-1.2+gh0.20140306/compile/Make_cyg.mak000066400000000000000000000021621230636573300202160ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Cygwin用Makefile # # Last Change: 28-Oct-2003. # Base Idea: AIDA Shinra # Maintainer: MURAOKA Taro ############################################################################## # 環境に応じてこの変数を変更する # DLLNAME = cygmigemo1.dll libmigemo_LIB = $(outdir)libmigemo.dll.a libmigemo_DSO = $(outdir)$(DLLNAME) EXEEXT = .exe CFLAGS_MIGEMO = LDFLAGS_MIGEMO = include config.mk include compile/unix.mak include src/depend.mak include compile/clean_unix.mak include compile/clean.mak ############################################################################## # 環境に応じてライブラリ構築法を変更する # $(libmigemo_LIB): $(libmigemo_DSO) $(libmigemo_DSO): $(libmigemo_OBJ) $(srcdir)migemo.def dllwrap -o $(libmigemo_DSO) --dllname $(DLLNAME) --implib $(libmigemo_LIB) --def $(srcdir)migemo.def $(libmigemo_OBJ) install-lib: $(libmigemo_DSO) $(libmigemo_LIB) $(INSTALL_DATA) $(libmigemo_LIB) $(libdir) $(INSTALL_PROGRAM) $(libmigemo_DSO) $(bindir) uninstall-lib: $(RM) $(bindir)/$(libmigemo_DSO) $(RM) $(libdir)/$(libmigemo_LIB) dictionary: cd dict && $(MAKE) cyg cmigemo-1.2+gh0.20140306/compile/Make_gcc.mak000066400000000000000000000024601230636573300201710ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # GNU/gcc(Linux他)用Makefile # # Last Change: 19-Oct-2003. # Base Idea: AIDA Shinra # Maintainer: MURAOKA Taro ############################################################################## # 環境に応じてこの変数を変更する # libmigemo_LIB = libmigemo.so.1.1.0 libmigemo_DSO = libmigemo.so.1 libmigemo = libmigemo.so EXEEXT = CFLAGS_MIGEMO = -fPIC LDFLAGS_MIGEMO = -Wl,-rpath,.,-rpath,/usr/local/lib,-rpath,/usr/lib include config.mk include compile/unix.mak include src/depend.mak include compile/clean_unix.mak include compile/clean.mak ############################################################################## # 環境に応じてライブラリ構築法を変更する # $(libmigemo_LIB): $(libmigemo_DSO) $(libmigemo_DSO): $(libmigemo_OBJ) $(CC) -shared -o $(libmigemo_LIB) -Wl,-soname,$@ $(libmigemo_OBJ) $(RM) $@ $(libmigemo) ln -s $(libmigemo_LIB) $@ ln -s $(libmigemo_LIB) $(libmigemo) install-lib: $(libmigemo_DSO) $(INSTALL_PROGRAM) $(libmigemo_LIB) $(libdir) $(RM) $(libdir)/$(libmigemo_DSO) $(libdir)/$(libmigemo) ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo_DSO) ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo) uninstall-lib: $(RM) $(libdir)/$(libmigemo_DSO) $(RM) $(libdir)/$(libmigemo_LIB) $(RM) $(libdir)/$(libmigemo) dictionary: cd dict && $(MAKE) gcc cmigemo-1.2+gh0.20140306/compile/Make_mvc.mak000066400000000000000000000026701230636573300202250ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Visual C++用 Makefile # # Last Change: 28-Oct-2003. # Maintainer: MURAOKA Taro default: rel !include config.mk !include compile\dos.mak !include src\depend.mak !include compile\clean_dos.mak !include compile\clean.mak !include dict\dict.mak libmigemo_LIB = $(outdir)migemo.lib libmigemo_DSO = $(outdir)migemo.dll libmigemo_SRC = $(SRC) libmigemo_OBJ = $(OBJ) !ifndef DEBUG DEFINES = -DNDEBUG CFLAGS = -G6 -W3 -O2 -MT LDFLAGS = !else DEFINES = -D_DEBUG CFLAGS = -Zi -W3 -Od -MTd LDFLAGS = -DEBUG !endif DEFINES = -DWIN32 -D_WINDOWS -D_CONSOLE -D_MBCS $(DEFINES) CFLAGS = -nologo -I $(srcdir) $(CFLAGS) $(DEFINES) $(CFLAGS_MIGEMO) LDFLAGS = -nologo $(LDFLAGS) $(LDFLAGS_MIGEMO) LIBS = LD = link.exe RC = rc.exe rel: dirs $(outdir)cmigemo.exe dirs: @for %i IN ($(outdir) $(objdir)) do @if not exist %inul $(MKDIR) %i {$(srcdir)}.c{$(objdir)}.$(O): $(CC) $(CFLAGS) -Fo$@ -c $< $(outdir)cmigemo.exe: $(libmigemo_LIB) $(objdir)main.obj $(LD) $(LDFLAGS) -OUT:$@ $(libmigemo_LIB) $(LIBS) $(objdir)main.obj $(objdir)migemo.res: $(srcdir)migemo.rc $(srcdir)resource.h $(RC) /i $(srcdir) /fo $@ $(srcdir)migemo.rc $(libmigemo_LIB): $(libmigemo_DSO) $(libmigemo_DSO): $(libmigemo_OBJ) $(srcdir)migemo.def $(objdir)migemo.res $(LD) $(LDFLAGS) -OUT:$@ $(libmigemo_OBJ) $(LIBS) $(objdir)migemo.res -DLL -DEF:$(srcdir)migemo.def -MAP:$(outdir)migemo.map dictionary: cd-dict msvc cd .. cd-dict: cd dict cmigemo-1.2+gh0.20140306/compile/Make_osx.mak000066400000000000000000000023511230636573300202450ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # MacOSX用Makefile # # Last Change: 19-Oct-2003. # Maintainer: MURAOKA Taro ############################################################################## # 環境に応じてこの変数を変更する # libmigemo_LIB = libmigemo.1.1.0.dylib libmigemo_DSO = libmigemo.1.dylib libmigemo = libmigemo.dylib EXEEXT = CFLAGS_MIGEMO = -fPIC LDFLAGS_MIGEMO = include config.mk include compile/unix.mak include src/depend.mak include compile/clean_unix.mak include compile/clean.mak ############################################################################## # 環境に応じてライブラリ構築法を変更する # $(libmigemo_LIB): $(libmigemo_DSO) $(libmigemo_DSO): $(libmigemo_OBJ) $(CC) -dynamiclib -install_name $@ -o $(libmigemo_LIB) $(libmigemo_OBJ) $(RM) $@ $(libmigemo) ln -s $(libmigemo_LIB) $@ ln -s $(libmigemo_LIB) $(libmigemo) install-lib: $(libmigemo_DSO) $(INSTALL_PROGRAM) $(libmigemo_LIB) $(libdir) $(RM) $(libdir)/$(libmigemo_DSO) $(libdir)/$(libmigemo) ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo_DSO) ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo) uninstall-lib: $(RM) $(libdir)/$(libmigemo_DSO) $(RM) $(libdir)/$(libmigemo_LIB) $(RM) $(libdir)/$(libmigemo) dictionary: cd dict && $(MAKE) osx cmigemo-1.2+gh0.20140306/compile/Make_sun.mak000066400000000000000000000025461230636573300202470ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Sun's Solaris/gcc $BMQ(B Makefile # # Last Change: 19-Oct-2003. # Base Idea: AIDA Shinra # Modified By: Hiroshi Fujishima # Maintainer: MURAOKA Taro ############################################################################## # $B4D6-$K1~$8$F$3$NJQ?t$rJQ99$9$k(B # CC = gcc libmigemo_LIB = libmigemo.so.1.1.0 libmigemo_DSO = libmigemo.so.1 libmigemo = libmigemo.so EXEEXT = CFLAGS_MIGEMO = -fPIC LDFLAGS_MIGEMO = -R/usr/local/lib include config.mk include compile/unix.mak include src/depend.mak include compile/clean_unix.mak include compile/clean.mak ############################################################################## # $B4D6-$K1~$8$F%i%$%V%i%j9=C[K!$rJQ99$9$k(B # $(libmigemo_LIB): $(libmigemo_DSO) $(libmigemo_DSO): $(libmigemo_OBJ) /usr/ccs/bin/ld -G -o $(libmigemo_LIB) -h $@ $(libmigemo_OBJ) $(RM) $@ $(libmigemo) ln -s $(libmigemo_LIB) $@ ln -s $(libmigemo_LIB) $(libmigemo) install-lib: $(libmigemo_DSO) $(INSTALL_PROGRAM) $(libmigemo_LIB) $(libdir) $(RM) $(libdir)/$(libmigemo_DSO) $(libdir)/$(libmigemo) ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo_DSO) ln -s $(libmigemo_LIB) $(libdir)/$(libmigemo) uninstall-lib: $(RM) $(libdir)/$(libmigemo_DSO) $(RM) $(libdir)/$(libmigemo_LIB) $(RM) $(libdir)/$(libmigemo) dictionary: cd dict && $(MAKE) gcc cmigemo-1.2+gh0.20140306/compile/clean.mak000066400000000000000000000013121230636573300175550ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Clean up アーキテクチャ非依存 # # Last Change: 29-Nov-2003. # Written By: MURAOKA Taro clean-migemo: -$(RM) $(DICT_DIR)migemo-dict distclean-migemo: -$(RM) $(outdir)cmigemo$(EXEEXT) -$(RM) libmigemo.*.dylib -$(RM) libmigemo.so* -$(RM) migemo.opt -$(RM) migemo.ncb -$(RMDIR) $(objdir) -$(RM) $(DICT_DIR)SKK-JISYO* -$(RM) $(DICT_DIR)base-dict -$(RMDIR) $(DICT_DIR)euc-jp.d clean: clean-arch clean-migemo -$(RM) *.a -$(RM) $(OBJ) -$(RM) *.lib -$(RM) *.tds -$(RMDIR) $(objdir) -$(RMDIR) Release -$(RMDIR) Debug distclean: clean distclean-arch distclean-migemo -$(RM) *.dll -$(RM) *.dylib -$(RM) tags -$(CP) $(CONFIG_DEFAULT) config.mk cmigemo-1.2+gh0.20140306/compile/clean_dos.mak000066400000000000000000000004631230636573300204300ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Clean up アーキテクチャ依存 (DOS/Windows) # # Last Change: 18-Oct-2003. # Written By: MURAOKA Taro # 次行の\のあとには半角スペースが必要→"\ " DICT_DIR = dict\ # BC5では空のチャンクはエラーになるので"\t@"が必要 clean-arch: @ distclean-arch: @ cmigemo-1.2+gh0.20140306/compile/clean_unix.mak000066400000000000000000000003061230636573300206220ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Clean up アーキテクチャ依存 (UNIX) # # Last Change: 16-May-2002. # Written By: MURAOKA Taro DICT_DIR = dict/ clean-arch: distclean-arch: cmigemo-1.2+gh0.20140306/compile/config.mk.in000066400000000000000000000022121230636573300202040ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Configuration file. # # Last Change: 29-Nov-2003. # Maintainer: MURAOKA Taro srcdir = ./src/ objdir = ./build/object/ outdir = ./build/ ############################################################################## # Install directories # prefix = /usr/local bindir = $(prefix)/bin libdir = $(prefix)/lib incdir = $(prefix)/include # WARNING: Directories $(dictdir) and $(docdir) will be deleted whole the # directory when unintall. dictdir = $(prefix)/share/migemo docdir = $(prefix)/doc/migemo ############################################################################## # Commands # RM = rm -f CP = cp MKDIR = mkdir -p RMDIR = rm -rf CTAGS = ctags HTTP = ${PROGRAM_HTTP} PERL = perl BUNZIP2 = bzip2 -d GUNZIP = gzip -d FILTER_CP932 = ${PROGRAM_ENCODEFILTER} -s FILTER_EUCJP = ${PROGRAM_ENCODEFILTER} -e INSTALL = ${PROGRAM_INSTALL} -c INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 ############################################################################## # Constants # O = o EXE = CONFIG_DEFAULT = compile/config_default.mk CONFIG_IN = ${config_in} cmigemo-1.2+gh0.20140306/compile/config_default.mk000066400000000000000000000023631230636573300213120ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # デフォルトコンフィギュレーションファイル # # Last Change: 29-Nov-2003. # Base Idea: AIDA Shinra # Maintainer: MURAOKA Taro srcdir = ./src/ objdir = ./build/object/ outdir = ./build/ ############################################################################## # インストールディレクトリの設定 # prefix = /usr/local bindir = $(prefix)/bin libdir = $(prefix)/lib incdir = $(prefix)/include # 警告: $(dictdir)と$(docdir)はアンインストール実行時にディレクトリごと消去 # されます。 dictdir = $(prefix)/share/migemo docdir = $(prefix)/doc/migemo ############################################################################## # コマンド設定 # RM = rm -f CP = cp MKDIR = mkdir -p RMDIR = rm -rf CTAGS = ctags HTTP = curl -O #HTTP = wget PERL = perl BUNZIP2 = bzip2 -d GUNZIP = gzip -d FILTER_CP932 = qkc -q -u -s FILTER_EUCJP = qkc -q -u -e #FILTER_CP932 = nkf -s #FILTER_EUCJP = nkf -e INSTALL = /usr/bin/install -c #INSTALL = /usr/ucb/install -c INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 ############################################################################## # 定数 # O = o EXE = CONFIG_DEFAULT = compile/config_default.mk CONFIG_IN = compile/config.mk.in cmigemo-1.2+gh0.20140306/compile/dll_migemo.dep000066400000000000000000000007051230636573300206100ustar00rootroot00000000000000# Microsoft Developer Studio Generated Dependency File, included by dll_migemo.mak .\migemo.c : \ ".\filename.h"\ ".\migemo.h"\ ".\mnode.h"\ ".\romaji.h"\ ".\rxgen.h"\ ".\wordbuf.h"\ ".\wordlist.h"\ .\mnode.c : \ ".\dbg.h"\ ".\mnode.h"\ ".\wordbuf.h"\ ".\wordlist.h"\ .\romaji.c : \ ".\romaji.h"\ ".\wordbuf.h"\ .\rxgen.c : \ ".\rxgen.h"\ ".\wordbuf.h"\ .\wordbuf.c : \ ".\wordbuf.h"\ .\wordlist.c : \ ".\wordlist.h"\ cmigemo-1.2+gh0.20140306/compile/dll_migemo.mak000066400000000000000000000137341230636573300206160ustar00rootroot00000000000000# Microsoft Developer Studio Generated NMAKE File, Based on dll_migemo.dsp !IF "$(CFG)" == "" CFG=dll_migemo - Win32 Debug !MESSAGE 構成が指定されていません。デフォルトの dll_migemo - Win32 Debug を設定します。 !ENDIF !IF "$(CFG)" != "dll_migemo - Win32 Release" && "$(CFG)" != "dll_migemo - Win32 Debug" !MESSAGE 指定された ビルド モード "$(CFG)" は正しくありません。 !MESSAGE NMAKE の実行時に構成を指定できます !MESSAGE コマンド ライン上でマクロの設定を定義します。例: !MESSAGE !MESSAGE NMAKE /f "dll_migemo.mak" CFG="dll_migemo - Win32 Debug" !MESSAGE !MESSAGE 選択可能なビルド モード: !MESSAGE !MESSAGE "dll_migemo - Win32 Release" ("Win32 (x86) Dynamic-Link Library" 用) !MESSAGE "dll_migemo - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" 用) !MESSAGE !ERROR 無効な構成が指定されています。 !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF !IF "$(CFG)" == "dll_migemo - Win32 Release" OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros ALL : "$(OUTDIR)\migemo.dll" CLEAN : -@erase "$(INTDIR)\filename.obj" -@erase "$(INTDIR)\migemo.obj" -@erase "$(INTDIR)\migemo.res" -@erase "$(INTDIR)\mnode.obj" -@erase "$(INTDIR)\romaji.obj" -@erase "$(INTDIR)\rxgen.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\wordbuf.obj" -@erase "$(INTDIR)\wordlist.obj" -@erase "$(OUTDIR)\migemo.dll" -@erase "$(OUTDIR)\migemo.exp" -@erase "$(OUTDIR)\migemo.lib" -@erase "$(OUTDIR)\migemo.map" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe CPP_PROJ=/nologo /G6 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLL_MIGEMO_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << MTL=midl.exe MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 RSC=rc.exe RSC_PROJ=/l 0x411 /fo"$(INTDIR)\migemo.res" /d "NDEBUG" BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\dll_migemo.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\migemo.pdb" /map:"$(INTDIR)\migemo.map" /machine:I386 /def:".\migemo.def" /out:"$(OUTDIR)\migemo.dll" /implib:"$(OUTDIR)\migemo.lib" DEF_FILE= \ ".\migemo.def" LINK32_OBJS= \ "$(INTDIR)\filename.obj" \ "$(INTDIR)\migemo.obj" \ "$(INTDIR)\mnode.obj" \ "$(INTDIR)\romaji.obj" \ "$(INTDIR)\rxgen.obj" \ "$(INTDIR)\wordbuf.obj" \ "$(INTDIR)\wordlist.obj" \ "$(INTDIR)\migemo.res" "$(OUTDIR)\migemo.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "dll_migemo - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "$(OUTDIR)\migemo.dll" CLEAN : -@erase "$(INTDIR)\filename.obj" -@erase "$(INTDIR)\migemo.obj" -@erase "$(INTDIR)\migemo.res" -@erase "$(INTDIR)\mnode.obj" -@erase "$(INTDIR)\romaji.obj" -@erase "$(INTDIR)\rxgen.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(INTDIR)\wordbuf.obj" -@erase "$(INTDIR)\wordlist.obj" -@erase "$(OUTDIR)\migemo.dll" -@erase "$(OUTDIR)\migemo.exp" -@erase "$(OUTDIR)\migemo.lib" -@erase "$(OUTDIR)\migemo.map" -@erase "$(OUTDIR)\migemo.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLL_MIGEMO_EXPORTS" /Fp"$(INTDIR)\dll_migemo.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << MTL=midl.exe MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 RSC=rc.exe RSC_PROJ=/l 0x411 /fo"$(INTDIR)\migemo.res" /d "_DEBUG" BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\dll_migemo.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\migemo.pdb" /map:"$(INTDIR)\migemo.map" /debug /machine:I386 /def:".\migemo.def" /out:"$(OUTDIR)\migemo.dll" /implib:"$(OUTDIR)\migemo.lib" /pdbtype:sept DEF_FILE= \ ".\migemo.def" LINK32_OBJS= \ "$(INTDIR)\filename.obj" \ "$(INTDIR)\migemo.obj" \ "$(INTDIR)\mnode.obj" \ "$(INTDIR)\romaji.obj" \ "$(INTDIR)\rxgen.obj" \ "$(INTDIR)\wordbuf.obj" \ "$(INTDIR)\wordlist.obj" \ "$(INTDIR)\migemo.res" "$(OUTDIR)\migemo.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("compile\dll_migemo.dep") !INCLUDE "compile\dll_migemo.dep" !ELSE !MESSAGE Warning: cannot find "compile\dll_migemo.dep" !ENDIF !ENDIF !IF "$(CFG)" == "dll_migemo - Win32 Release" || "$(CFG)" == "dll_migemo - Win32 Debug" SOURCE=.\filename.c "$(INTDIR)\filename.obj" : $(SOURCE) "$(INTDIR)" SOURCE=.\migemo.c "$(INTDIR)\migemo.obj" : $(SOURCE) "$(INTDIR)" SOURCE=.\migemo.rc "$(INTDIR)\migemo.res" : $(SOURCE) "$(INTDIR)" $(RSC) $(RSC_PROJ) $(SOURCE) SOURCE=.\mnode.c "$(INTDIR)\mnode.obj" : $(SOURCE) "$(INTDIR)" SOURCE=.\romaji.c "$(INTDIR)\romaji.obj" : $(SOURCE) "$(INTDIR)" SOURCE=.\rxgen.c "$(INTDIR)\rxgen.obj" : $(SOURCE) "$(INTDIR)" SOURCE=.\wordbuf.c "$(INTDIR)\wordbuf.obj" : $(SOURCE) "$(INTDIR)" SOURCE=.\wordlist.c "$(INTDIR)\wordlist.obj" : $(SOURCE) "$(INTDIR)" !ENDIF cmigemo-1.2+gh0.20140306/compile/dos.mak000066400000000000000000000007631230636573300172710ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # アーキテクチャ依存 (DOS/Windows) # # Last Change: 29-Nov-2003. # Written By: MURAOKA Taro # Maintainer: MURAOKA Taro srcdir = .\src\ # objdir = .\build\object\ # outdir = .\build\ # # Borlandのmakeでは後ろにコメントを付けることで行末に\を含めることができる CP = copy MKDIR = mkdir RM = del /F /Q RMDIR = rd /S /Q O = obj EXE = .exe CONFIG_DEFAULT = compile\config_default.mk CONFIG_IN = compile\config.mk.in cmigemo-1.2+gh0.20140306/compile/migemo.dep000066400000000000000000000001561230636573300177550ustar00rootroot00000000000000# Microsoft Developer Studio Generated Dependency File, included by migemo.mak .\main.c : \ ".\migemo.h"\ cmigemo-1.2+gh0.20140306/compile/migemo.mak000066400000000000000000000126651230636573300177650ustar00rootroot00000000000000# Microsoft Developer Studio Generated NMAKE File, Based on migemo.dsp !IF "$(CFG)" == "" CFG=migemo - Win32 Release !MESSAGE 構成が指定されていません。デフォルトの migemo - Win32 Release を設定します。 !ENDIF !IF "$(CFG)" != "migemo - Win32 Release" && "$(CFG)" != "migemo - Win32 Debug" !MESSAGE 指定された ビルド モード "$(CFG)" は正しくありません。 !MESSAGE NMAKE の実行時に構成を指定できます !MESSAGE コマンド ライン上でマクロの設定を定義します。例: !MESSAGE !MESSAGE NMAKE /f "migemo.mak" CFG="migemo - Win32 Release" !MESSAGE !MESSAGE 選択可能なビルド モード: !MESSAGE !MESSAGE "migemo - Win32 Release" ("Win32 (x86) Console Application" 用) !MESSAGE "migemo - Win32 Debug" ("Win32 (x86) Console Application" 用) !MESSAGE !ERROR 無効な構成が指定されています。 !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF !IF "$(CFG)" == "migemo - Win32 Release" OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros !IF "$(RECURSE)" == "0" ALL : "$(OUTDIR)\cmigemo.exe" !ELSE ALL : "dll_migemo - Win32 Release" "$(OUTDIR)\cmigemo.exe" !ENDIF !IF "$(RECURSE)" == "1" CLEAN :"dll_migemo - Win32 ReleaseCLEAN" !ELSE CLEAN : !ENDIF -@erase "$(INTDIR)\main.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(OUTDIR)\cmigemo.exe" -@erase "$(OUTDIR)\cmigemo.map" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe CPP_PROJ=/nologo /G6 /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_SPLITED_MIGEMO" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << RSC=rc.exe BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\migemo.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\cmigemo.pdb" /map:"$(INTDIR)\cmigemo.map" /machine:I386 /out:"$(OUTDIR)\cmigemo.exe" LINK32_OBJS= \ "$(INTDIR)\main.obj" \ "$(OUTDIR)\migemo.lib" "$(OUTDIR)\cmigemo.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "migemo - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros !IF "$(RECURSE)" == "0" ALL : "$(OUTDIR)\cmigemo.exe" !ELSE ALL : "dll_migemo - Win32 Debug" "$(OUTDIR)\cmigemo.exe" !ENDIF !IF "$(RECURSE)" == "1" CLEAN :"dll_migemo - Win32 DebugCLEAN" !ELSE CLEAN : !ENDIF -@erase "$(INTDIR)\main.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(OUTDIR)\cmigemo.exe" -@erase "$(OUTDIR)\cmigemo.map" -@erase "$(OUTDIR)\cmigemo.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe CPP_PROJ=/nologo /MLd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_SPLITED_MIGEMO" /Fp"$(INTDIR)\migemo.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << RSC=rc.exe BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\migemo.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\cmigemo.pdb" /map:"$(INTDIR)\cmigemo.map" /debug /machine:I386 /out:"$(OUTDIR)\cmigemo.exe" /pdbtype:sept LINK32_OBJS= \ "$(INTDIR)\main.obj" \ "$(OUTDIR)\migemo.lib" "$(OUTDIR)\cmigemo.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("compile\migemo.dep") !INCLUDE "compile\migemo.dep" !ELSE !MESSAGE Warning: cannot find "compile\migemo.dep" !ENDIF !ENDIF !IF "$(CFG)" == "migemo - Win32 Release" || "$(CFG)" == "migemo - Win32 Debug" SOURCE=.\main.c "$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)" !IF "$(CFG)" == "migemo - Win32 Release" "dll_migemo - Win32 Release" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\compile\dll_migemo.mak CFG="dll_migemo - Win32 Release" cd "." "dll_migemo - Win32 ReleaseCLEAN" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\compile\dll_migemo.mak CFG="dll_migemo - Win32 Release" RECURSE=1 CLEAN cd "." !ELSEIF "$(CFG)" == "migemo - Win32 Debug" "dll_migemo - Win32 Debug" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\compile\dll_migemo.mak CFG="dll_migemo - Win32 Debug" cd "." "dll_migemo - Win32 DebugCLEAN" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\compile\dll_migemo.mak CFG="dll_migemo - Win32 Debug" RECURSE=1 CLEAN cd "." !ENDIF !ENDIF cmigemo-1.2+gh0.20140306/compile/old_mvc.mak000066400000000000000000000007021230636573300201200ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # Visual C++用 Makefile # # Last Change: 27-May-2002. # Written By: MURAOKA Taro default: rel !include config.mk !include compile/clean_dos.mak !include compile/clean.mak !include dict/dict.mak rel: $(MAKE) /nologo /f compile\migemo.mak CFG="migemo - Win32 Release" dbg: $(MAKE) /nologo /f compile\migemo.mak CFG="migemo - Win32 Debug" dictionary: cd-dict msvc cd .. cd-dict: cd dict cmigemo-1.2+gh0.20140306/compile/unix.mak000066400000000000000000000037251230636573300174700ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # UNIX系共通Makefile # # Last Change: 29-Oct-2003. # Base Idea: AIDA Shinra # Maintainer: MURAOKA Taro libmigemo_SRC = $(SRC) libmigemo_OBJ = $(OBJ) DEFINES = CFLAGS = -O2 -Wall $(DEFINES) $(CFLAGS_MIGEMO) LDFLAGS = $(LDFLAGS_MIGEMO) LIBS = default: dirs $(outdir)cmigemo$(EXEEXT) dirs: @for i in $(objdir) $(outdir); do \ if test ! -d $$i; then \ $(MKDIR) $$i; \ fi \ done $(outdir)cmigemo$(EXEEXT): $(objdir)main.$(O) $(libmigemo_LIB) $(CC) -o $@ $(objdir)main.$(O) -L. -L$(outdir) -lmigemo $(LDFLAGS) $(objdir)main.o: $(srcdir)main.c $(CC) $(CFLAGS) -o $@ -c $< $(objdir)%.o: $(srcdir)%.c $(CC) $(CFLAGS) -o $@ -c $< ############################################################################## # Install # install-mkdir: $(MKDIR) $(bindir) $(MKDIR) $(libdir) $(MKDIR) $(incdir) $(MKDIR) $(docdir) $(MKDIR) $(dictdir) $(MKDIR) $(dictdir)/cp932 $(MKDIR) $(dictdir)/euc-jp install-dict: $(INSTALL_DATA) dict/migemo-dict $(dictdir)/cp932 $(INSTALL_DATA) dict/han2zen.dat $(dictdir)/cp932 $(INSTALL_DATA) dict/hira2kata.dat $(dictdir)/cp932 $(INSTALL_DATA) dict/roma2hira.dat $(dictdir)/cp932 if [ -d dict/euc-jp.d ]; then \ $(INSTALL_DATA) dict/euc-jp.d/migemo-dict $(dictdir)/euc-jp; \ $(INSTALL_DATA) dict/euc-jp.d/han2zen.dat $(dictdir)/euc-jp; \ $(INSTALL_DATA) dict/euc-jp.d/hira2kata.dat $(dictdir)/euc-jp; \ $(INSTALL_DATA) dict/euc-jp.d/roma2hira.dat $(dictdir)/euc-jp; \ fi install: $(outdir)cmigemo$(EXEEXT) $(libmigemo_DSO) install-mkdir install-dict install-lib $(INSTALL_DATA) $(srcdir)migemo.h $(incdir) $(INSTALL_DATA) doc/README_j.txt $(docdir) $(INSTALL_PROGRAM) $(outdir)cmigemo$(EXEEXT) $(bindir) ############################################################################## # Uninstall # uninstall: uninstall-lib $(RM) $(dictdir)/migemo-dict* $(RM) $(incdir)/migemo.h $(RM) $(docdir)/README_j.txt $(RM) $(bindir)/cmigemo$(EXEEXT) $(RMDIR) $(dictdir) $(RMDIR) $(docdir) cmigemo-1.2+gh0.20140306/config.mk000066400000000000000000000023631230636573300161560ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # デフォルトコンフィギュレーションファイル # # Last Change: 29-Nov-2003. # Base Idea: AIDA Shinra # Maintainer: MURAOKA Taro srcdir = ./src/ objdir = ./build/object/ outdir = ./build/ ############################################################################## # インストールディレクトリの設定 # prefix = /usr/local bindir = $(prefix)/bin libdir = $(prefix)/lib incdir = $(prefix)/include # 警告: $(dictdir)と$(docdir)はアンインストール実行時にディレクトリごと消去 # されます。 dictdir = $(prefix)/share/migemo docdir = $(prefix)/doc/migemo ############################################################################## # コマンド設定 # RM = rm -f CP = cp MKDIR = mkdir -p RMDIR = rm -rf CTAGS = ctags HTTP = curl -O #HTTP = wget PERL = perl BUNZIP2 = bzip2 -d GUNZIP = gzip -d FILTER_CP932 = qkc -q -u -s FILTER_EUCJP = qkc -q -u -e #FILTER_CP932 = nkf -s #FILTER_EUCJP = nkf -e INSTALL = /usr/bin/install -c #INSTALL = /usr/ucb/install -c INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 ############################################################################## # 定数 # O = o EXE = CONFIG_DEFAULT = compile/config_default.mk CONFIG_IN = compile/config.mk.in cmigemo-1.2+gh0.20140306/configure000077500000000000000000000030171230636573300162640ustar00rootroot00000000000000#!/bin/sh # vim:set ts=8 sts=2 sw=2 tw=0: # # configure - Easy configuration script # # Last Change: 07-Dec-2003. # Author & Maintainer: MURAOKA Taro config_out=config.mk config_in=compile/config.mk.in config_default=compile/config_default.mk CHECK_COMMAND() { if test -e "`which $1 2>/dev/null`" ; then return 0 else return 1 fi } # Check HTTP access tool if CHECK_COMMAND curl ; then PROGRAM_HTTP="curl -O" elif CHECK_COMMAND wget ; then PROGRAM_HTTP="wget" elif CHECK_COMMAND fetch ; then PROGRAM_HTTP="fetch" else echo "ERROR: Require one of HTTP access tools (curl, wget or fetch)." exit 1 fi # Check encoding filter if CHECK_COMMAND qkc ; then PROGRAM_ENCODEFILTER="qkc -q -u" elif CHECK_COMMAND nkf ; then PROGRAM_ENCODEFILTER="nkf" else echo "ERROR: Require qkc or nkf installed for encode filter." exit 1 fi # Check install program if test -x /usr/ucb/install ; then PROGRAM_INSTALL="/usr/ucb/install" elif test -x /usr/bin/install ; then PROGRAM_INSTALL="/usr/bin/install" else PROGRAM_INSTALL="/usr/bin/install" echo "WARNING: Can't find install program." echo " But set it \"/usr/bin/install\". So need to make sure." fi # for Debug if test 0 != 0 ; then echo "PROGRAM_HTTP=${PROGRAM_HTTP}" 1>&2 echo "PROGRAM_ENCODEFILTER=${PROGRAM_ENCODEFILTER}" 1>&2 echo "PROGRAM_INSTALL=${PROGRAM_INSTALL}" 1>&2 fi # Generate config.mk while read line ; do case "$line" in *\$\{*) eval "echo $line" ;; *) echo $line esac done < $config_in > $config_out cmigemo-1.2+gh0.20140306/dict/000077500000000000000000000000001230636573300152775ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/dict/.cvsignore000066400000000000000000000000701230636573300172740ustar00rootroot00000000000000SKK-JISYO* base-dict euc-jp.d migemo-dict migemo-dict.* cmigemo-1.2+gh0.20140306/dict/Makefile000066400000000000000000000003541230636573300167410ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # 辞書ファイルのメンテナンス(スタブ) # # Last Change: 16-May-2002. # Written By: MURAOKA Taro include ../config.mk include dict.mak clean: dict-clean distclean: dict-distclean cmigemo-1.2+gh0.20140306/dict/dict.mak000066400000000000000000000043471230636573300167240ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # 辞書ファイルのメンテナンス # # Last Change: 21-Dec-2002. # Written By: MURAOKA Taro # 必須プログラム # Perl, cURL, qkc, (cp, rm, mkdir) DICT = migemo-dict DICT_BASE = base-dict SKKDIC_BASEURL = http://openlab.ring.gr.jp/skk/dic SKKDIC_FILE = SKK-JISYO.L EUCJP_DIR = euc-jp.d ############################################################################## # Dictionary # $(DICT): $(DICT_BASE) $(FILTER_CP932) < $(DICT_BASE) > $@ $(DICT_BASE): $(SKKDIC_FILE) ../tools/skk2migemo.pl ../tools/optimize-dict.pl $(PERL) ../tools/skk2migemo.pl < $(SKKDIC_FILE) > dict.tmp $(PERL) ../tools/optimize-dict.pl < dict.tmp > $@ -$(RM) dict.tmp $(SKKDIC_FILE): $(HTTP) $(SKKDIC_BASEURL)/$@.gz $(GUNZIP) $@.gz ############################################################################## # Dictionary in cp932 # cp932: $(DICT) ############################################################################## # Dictionary in euc-jp # euc-jp: cp932 euc-jp-files euc-jp-files: $(EUCJP_DIR) $(EUCJP_DIR)/migemo-dict $(EUCJP_DIR)/han2zen.dat \ $(EUCJP_DIR)/hira2kata.dat $(EUCJP_DIR)/roma2hira.dat $(EUCJP_DIR): $(MKDIR) $(EUCJP_DIR) $(EUCJP_DIR)/migemo-dict: migemo-dict $(FILTER_EUCJP) < migemo-dict > $@ $(EUCJP_DIR)/han2zen.dat: han2zen.dat $(FILTER_EUCJP) < han2zen.dat > $@ $(EUCJP_DIR)/hira2kata.dat: hira2kata.dat $(FILTER_EUCJP) < hira2kata.dat > $@ $(EUCJP_DIR)/roma2hira.dat: roma2hira.dat $(FILTER_EUCJP) < roma2hira.dat > $@ ############################################################################## # for Microsoft Visual C # msvc: cp932 ############################################################################## # for Borland C 5 # bc5: cp932 ############################################################################## # for Cygwin # cyg: euc-jp ############################################################################## # for GNU/gcc(Linux他) # gcc: euc-jp ############################################################################## # for MacOS X # osx: euc-jp ############################################################################## # Cleaning # dict-clean: -$(RM) $(DICT) -$(RMDIR) $(EUCJP_DIR) dict-distclean: dict-clean -$(RM) $(DICT_BASE) -$(RM) SKK-JISYO* cmigemo-1.2+gh0.20140306/dict/han2zen.dat000066400000000000000000000021521230636573300173360ustar00rootroot00000000000000# vi:set ts=8 sts=8 sw=8 tw=0: # # han2zen.dat - 半角→全角変換表 # # Last Change: 14-Aug-2001. # Written By: Muraoka Taro # 漢字コードの違いもこの変換表で吸収する。 # 半角→全角スペース変換はデリミタをisspace()で定義してしまったのでできてい # ない。 #   ! ! " ” # シャープの変換はコメントとみなされるのでできていない。 # # $ $ % % & & ' ’ ( ( ) ) * * + + , , - − . . / / 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 : : ; ; < < = = > > ? ? @ @ A A B B C C D D E E F F G G H H I I J J K K L L M M N N O O P P Q Q R R S S T T U U V V W W X X Y Y Z Z [ [ \ ¥ ] ] ^ ^ _ _ ` ‘ a a b b c c d d e e f f g g h h i i j j k k l l m m n n o o p p q q r r s s t t u u v v w w x x y y z z { { | | } } ~ 〜 。 。 「 「 」 」 、 、 ・ ・ ヲ ヲ ァ ァ ィ ィ ゥ ゥ ェ ェ ォ ォ ャ ャ ュ ュ ョ ョ ッ ッ ー ー ア ア イ イ ウ ウ エ エ オ オ カ カ キ キ ク ク ケ ケ コ コ サ サ シ シ ス ス セ セ ソ ソ タ タ チ チ ツ ツ テ テ ト ト ナ ナ ニ ニ ヌ ヌ ネ ネ ノ ノ ハ ハ ヒ ヒ フ フ ヘ ヘ ホ ホ マ マ ミ ミ ム ム メ メ モ モ ヤ ヤ ユ ユ ヨ ヨ ラ ラ リ リ ル ル レ レ ロ ロ ワ ワ ン ン ゙ ゛ ゚ ゜ cmigemo-1.2+gh0.20140306/dict/hira2kata.dat000066400000000000000000000013131230636573300176350ustar00rootroot00000000000000# vi:set ts=8 sts=8 sw=8 tw=0: # # hira2kata.dat - 平仮名→カタカナ変換表 # # Last Change: 11-Aug-2001. # Written By: Muraoka Taro # 漢字コードの違いもこの変換表で吸収する。 あ ア い イ う ウ え エ お オ か カ き キ く ク け ケ こ コ さ サ し シ す ス せ セ そ ソ た タ ち チ つ ツ て テ と ト な ナ に ニ ぬ ヌ ね ネ の ノ は ハ ひ ヒ ふ フ へ ヘ ほ ホ ま マ み ミ む ム め メ も モ や ヤ ゆ ユ よ ヨ ら ラ り リ る ル れ レ ろ ロ わ ワ ゐ ヰ ゑ ヱ を ヲ が ガ ぎ ギ ぐ グ げ ゲ ご ゴ ざ ザ じ ジ ず ズ ぜ ゼ ぞ ゾ だ ダ ぢ ヂ づ ヅ で デ ど ド ば バ び ビ ぶ ブ べ ベ ぼ ボ ぱ パ ぴ ピ ぷ プ ぺ ペ ぽ ポ ぁ ァ ぃ ィ ぅ ゥ ぇ ェ ぉ ォ ゃ ャ ゅ ュ ょ ョ ん ン っ ッ ゎ ヮ cmigemo-1.2+gh0.20140306/dict/roma2hira.dat000066400000000000000000000051541230636573300176620ustar00rootroot00000000000000# vi:set ts=8 sts=8 sw=8 tw=0: # # roma2hira.dat - ローマ字→平仮名変換表 # # Last Change: 18-Oct-2003. # Written By: Muraoka Taro # こいつをカスタマイズすることでローマ字の入力方式が変わります。 # 現在はMS-IME2000を参考に決定しています。 # 漢字コードの違いを吸収する役割も果たします。 # xnとxtuには「ん」と「っ」を指定する役割があります。 # {from} {to}の形式です。 # 現在は{from}は最大7バイトまで{to}は6バイトまでとなっています。 # {from}と{to}の間は空白文字(isspace())で区切ります。 a あ i い u う e え o お ka か ki き ku く ke け ko こ sa さ si し su す se せ so そ ta た ti ち tu つ te て to と na な ni に nu ぬ ne ね no の ha は hi ひ hu ふ he へ ho ほ ma ま mi み mu む me め mo も ya や yi い yu ゆ ye いぇ yo よ ra ら ri り ru る re れ ro ろ wa わ wi ゐ wu う we ゑ wo を ga が gi ぎ gu ぐ ge げ go ご za ざ zi じ zu ず ze ぜ zo ぞ da だ di ぢ du づ de で do ど ba ば bi び bu ぶ be べ bo ぼ pa ぱ pi ぴ pu ぷ pe ぺ po ぽ la ぁ li ぃ lu ぅ le ぇ lo ぉ lya ゃ lyi ぃ lyu ゅ lye ぇ lyo ょ xa ぁ xi ぃ xu ぅ xe ぇ xo ぉ xya ゃ xyi ぃ xyu ゅ xye ぇ xyo ょ kya きゃ kyi きぃ kyu きゅ kye きぇ kyo きょ gwa ぐぁ gwi ぐぃ gwu ぐぅ gwe ぐぇ gwo ぐぉ gya ぎゃ gyi ぎぃ gyu ぎゅ gye ぎぇ gyo ぎょ sha しゃ shi し shu しゅ she しぇ sho しょ swa すぁ swi すぃ swu すぅ swe すぇ swo すぉ sya しゃ syi しぃ syu しゅ sye しぇ syo しょ tha てゃ thi てぃ thu てゅ the てぇ tho てょ tsa つぁ tsi つぃ tsu つ tse つぇ tso つぉ twa とぁ twi とぃ twu とぅ twe とぇ two とぉ tya ちゃ tyi ちぃ tyu ちゅ tye ちぇ tyo ちょ nya にゃ nyi にぃ nyu にゅ nye にぇ nyo にょ hya ひゃ hyi ひぃ hyu ひゅ hye ひぇ hyo ひょ bya びゃ byi びぃ byu びゅ bye びぇ byo びょ pya ぴゃ pyi ぴぃ pyu ぴゅ pye ぴぇ pyo ぴょ mya みゃ myi みぃ myu みゅ mye みぇ myo みょ rya りゃ ryi りぃ ryu りゅ rye りぇ ryo りょ ca か ci し cu く ce せ co こ cha ちゃ chi ち chu ちゅ che ちぇ cho ちょ fa ふぁ fi ふぃ fu ふ fe ふぇ fo ふぉ fwa ふぁ fwi ふぃ fwu ふぅ fwe ふぇ fwo ふぉ fya ふゃ fyi ふぃ fyu ふゅ fye ふぇ fyo ふょ ja じゃ ji じ ju じゅ je じぇ jo じょ jya じゃ jyi じぃ jyu じゅ jye じぇ jyo じょ qa くぁ qi くぃ qu く qe くぇ qo くぉ qwa くぁ qwi くぃ qwu くぅ qwe くぇ qwo くぉ qya くゃ qyi くぃ qyu くゅ qye くぇ qyo くょ va ヴぁ vi ヴぃ vu ヴ ve ヴぇ vo ヴぉ vya ヴゃ vyi ヴぃ vyu ヴゅ vye ヴぇ vyo ヴょ nn ん n' ん xn ん ltu っ xtu っ lwa ゎ xwa ゎ lka ヵ xka ヵ lke ヶ xke ヶ kwa くぁ - ー ~ 〜 #, 、 #. 。 #[ 「 #] 」 mba んば mbi んび mbu んぶ mbe んべ mbo んぼ mpa んぱ mpi んぴ mpu んぷ mpe んぺ mpo んぽ mma んま mmi んみ mmu んむ mme んめ mmo んも tcha っちゃ tchi っち tchu っちゅ tche っちぇ tcho っちょ cmigemo-1.2+gh0.20140306/doc/000077500000000000000000000000001230636573300151215ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/doc/.cvsignore000066400000000000000000000000051230636573300171140ustar00rootroot00000000000000html cmigemo-1.2+gh0.20140306/doc/LICENSE_j.txt000066400000000000000000000037611230636573300172640ustar00rootroot00000000000000C/Migemo及びMigemo DLLの利用許諾条件 Since: 16-Dec-2001 Version: 1.0 Author: MURAOKA Taro (KoRoN) Last Change: 16-Dec-2003. 用語定義 各用語の意味は以下のように定義します。 本ソフトウェア : C/Migemo及びMigemo DLL (バイナリとソースコードを含み、辞書データを除く) 不良動作 : 文書と異なる、もしくは明記されていない動作 管理者 : 本ソフトウェアを所有する人(作成者、著作権者) (本条件作成時 村岡太郎 ) 利用者 : 本ソフトウェアを利用する・した人 第三者 : 管理者及び利用者に該当しない第三者 (特に辞書データの作成者、著作権者を含む) 本則 本ソフトウェアは、以下の諸条件に同意された方のみ利用が許可されます。同意でき ない場合は本ソフトウェアの利用を中止し、関連ファイルを利用者の記憶媒体から削 除してください。 管理者に対する条件 管理者は、本ソフトウェアに関して以下の権利を有します。 - 本ソフトウェアを改変する権利 - 本ソフトウェアを配布する権利 - 本ソフトウェアの利用を許可する権利 - 権利の一部または全部を譲渡する権利 管理者は、本ソフトウェアの不良動作を回復する義務を有します。 管理者は、利用者が生じたまたは受けた損害について免責されます。 利用者に対する条件 利用者は、本ソフトウェアを利用する際に以下の義務を有します。 - 別途定める対価規定に基づく対価の支払い義務 - 管理者の権利を保護する義務 - 第三者の権利を保護する義務 利用者は、他の諸条件に矛盾しない限り、本ソフトウェアをあらゆる目的で利用する 権利を有します。 対価規定 本ソフトウェアの利用対価は以下のように定めます。 - 金 0円 以上 諸条件に合意できない場合は本ソフトウェアの利用を中止してください。 vim:set ts=8 sts=2 sw=2 tw=78 et ft=memo: cmigemo-1.2+gh0.20140306/doc/README_j.txt000066400000000000000000000405301230636573300171320ustar00rootroot00000000000000C/Migemoライブラリ説明書 Since: 15-Aug-2001 Version: 1.2.0 Author: MURAOKA Taro (KoRoN) Last Change: 29-Dec-2003. 説明 C/MigemoはMigemo(Ruby/Migemo)をC言語で実装したものです。C/Migemoライブラリを 利用するソフトウェアは「ローマ字のまま日本語を(インクリメンタルに)検索する」 機能を持つことが可能になります。C言語で実装したことにより、本家Ruby/Migemoに 比べ、C言語で書かれた多くのソフトウェアからの利用が容易になること、及び(たぶ ん)実行速度の向上が期待できます。 またC/Migemoを利用するためには別途辞書ファイル(dict/migemo-dict)を作成もしく は入手する必要があります。自分でまったくのゼロから辞書を作成することもできま すが、Ruby/Migemoのmigemo-dictを流用したり、SKKの辞書からコンバートすること も可能です。詳しくは下記の「辞書について」のセクションを参照してください。 Ruby/Migemoは高林 哲さんが考案した「ローマ字入力を日本語検索のための正規表現 に変換する」ツールです。Emacs上でローマ字のまま日本語をインクリメンタル検索 するために、RubyとEmacs LISPで実装されていました。 - 本家Ruby/Migemoサイト (Migemoに関する詳細情報) http://migemo.namazu.org/ - C/Migemo製作・配布サイト (C/Migemoの情報) http://www.kaoriya.net/ ファイル構成 C/Migemoのパッケージは現在のところ次のようなファイル・ディレクトリから構成さ れています。 (ディレクトリ) compile/ :各プラットホーム用のメイクファイル置き場 doc/ :ドキュメント置き場 dict/ :辞書置き場 msvc/ :VC6用プロジェクトファイル群 tools/ :各種ツール src/ :ソースファイル (ファイル) Makefile :統合メイクファイル README.txt :各ドキュメントへのポインタ VERSION :バージョン番号 config.mk :デフォルトコンフィギュレーション (ソースコード) src/内 depend.mak :構成ファイルと依存関係 migemo.h :ライブラリを利用するのためのインクルードファイル main.c :ライブラリを利用するサンプルプログラム(cmigemo) *.c :ライブラリのソース *.h :ライブラリのソース用インクルードファイル コンパイル方法 コンパイルには以下の3段階の手順があります。 1. ライブラリとプログラムのビルド 2. 辞書ファイルのビルド 3. インストール 「辞書ファイルのビルド」には別途以下の4種が必要になります。 1. Perl 2. インターネットアクセスプログラム(cURL, wget, fetchの内どれか1つ) 3. 解凍伸長プログラムgzip 4. エンコード変換プログラム(nkf, qkc) これらを含むC/Migemoのビルドに必要な外部プログラムはconfig.mkを編集すること で変更可能です。また以下のプラットホーム別のビルド方法で利用しているように UNIXライクな環境では自動的にconfig.mkを修正する仕組み(configure)を利用できま す。config.mkのオリジナルファイルはcompile/config_default.mkとして収録してあ るのでいつでも復元可能です。 各プラットホームでのビルド方法の具体例は以下を参照してください。 1. Windows + VisualC++ 2. Windows + Cygwin 3. Windows + Borland C++ 4. MacOS X + Developer Tools 5. GNU/gcc:Linux他 現在のところ以上5環境で動作の確認をしています。5.のGNU/gccについてはFreeBSD 5.0です。 (Windows + VisualC++) 次のコマンドでRelease/内にmigemo.dllとcmigemo.exeが作成されます。 > nmake msvc 必要な外部プログラム、ネットワーク接続が揃っていれば > nmake msvc-dict で辞書ファイルをビルドできます。migemo.dswをVC++6.0で開き、ビルドする方法も あります。以上が終了すれば次のコマンドでテストプログラムが動作します。 > .\build\cmigemo -d dict/migemo-dict (Windows + Cygwin) 必要な外部プログラム、ネットワーク接続を揃えて以下を実行することでテストプロ グラムcmigemoと辞書ファイルがビルドされます: $ ./configure $ make cyg $ make cyg-dict 実行はcp932(Shift-JIS)で利用するならば: $ ./build/cmigemo -d dict/migemo-dict euc-jpで利用するならば: $ ./build/cmigemo -d dict/euc-jp.d/migemo-dict を実行します。インストールとアンインストールはroot権限で次のコマンドを実行す ることで行なえます。インストール場所についてはconfig.mkを参照してください。 # make cyg-install # make cyg-uninstall (Windows + Borland C++) 次のコマンドでmigemo.dllとcmigemo.exeが作成されます。 > make bc 必要な外部プログラム、ネットワーク接続が揃っていれば > nmake bc-dict で辞書ファイルをビルドできます。以上が終了すれば次のコマンドでテストプログラ ムが動作します。 > .\build\cmigemo -d dict/migemo-dict (MacOS X + Developer Tools) 必要な外部プログラム、ネットワーク接続を揃えて以下を実行することでテストプロ グラムcmigemoと辞書ファイルがビルドされます: % ./configure % make osx % make osx-dict 実行はcp932(Shift-JIS)で利用するならば: % ./build/cmigemo -d dict/migemo-dict euc-jpで利用するならば: % ./build/cmigemo -d dict/euc-jp.d/migemo-dict を実行します。インストールとアンインストールはroot権限で次のコマンドを実行す ることで行なえます。インストール場所についてはconfig.mkを参照してください。 # make osx-install # make osx-uninstall インストールにより辞書ファイルは /usr/local/share/migemo/{エンコード名} に置かれます。 (GNU/gcc:Linux他) 必要な外部プログラム、ネットワーク接続を揃えて以下を実行することでテストプロ グラムcmigemoと辞書ファイルがビルドされます: $ ./configure $ make gcc $ make gcc-dict 実行はcp932(Shift-JIS)で利用するならば: $ ./build/cmigemo -d dict/migemo-dict euc-jpで利用するならば: $ ./build/cmigemo -d dict/euc-jp.d/migemo-dict を実行します。インストールとアンインストールはroot権限で次のコマンドを実行す ることで行なえます。インストール場所についてはconfig.mkを参照してください。 # make gcc-install # make gcc-uninstall インストールにより辞書ファイルは /usr/local/share/migemo/{エンコード名} に置かれます。 利用許諾条件 doc/LICENSE_j.txtを参照してください。 辞書の著作権・利用許諾条件 C/Migemoで利用する辞書の諸権利、利用許諾条件及び著作権等はその辞書の定めると ころに従います。C/MigemoはSKK辞書を用いるように初期設定されていますが、SKK辞 書の利用許諾条件はC/Migemoのそれとは法的に別であることに注意してください。 質問・連絡先 C/Migemoに関する質問・要望等は村岡(下記アドレス参照)まで連絡してください。ソ フトウェアからC/Migemoを使用したい場合の問い合わせも受け付けます。 謝辞 Migemoを発案されRuby/Migemoを作成され、C/Migemoについての相談にMLで親切に答 えていただいた高林 哲さんに感謝いたします。また、この配布パッケージには以下 の方々によるドキュメントやアイデアが含まれています。ありがとうございます。 (アルファベット順) - AIDA Shinra CygwinとLinux用Makefileの基礎 - FUJISHIMA Hiroshi Solaris用Makefileの提供 - MATSUMOTO Yasuhiro Borland C++用Makefileの基礎 migemo.vimをcmigemoに対応 - SUNAOKA Norifumi Solaris用Makefileの不具合報告 付録 辞書について {{{1 C/Migemoではローマ字を日本語へ変換するのに辞書ファイルdict/migemo-dictを必要 とします。ファイルdict/migemo-dictはこのアーカイブに含まれていませんが、辞書 ファイルのビルド時にインターネットを通じて自動的にダウンロードする仕組みにな っています。また大変ですが自分で0から作成することも可能です。 辞書に関するツール、その使用法はdict/Makefileを参照してください。 C/Migemoでは 1. dict/migemo-dict以外にも、 2. ローマ字を平仮名に変換するためのファイル(dict/roma2hira.dat)や、 3. 平仮名を片仮名に変換するためのファイル(dict/hira2kata.dat)や、 4. 半角文字を全角文字に変換するためのファイル(dict/han2zen.dat) を使用しています。これらの全てのファイルは単にデータテーブルとして機能してい るだけでなく、システムのエンコード(漢字コード)の違いを吸収する役割も担ってい ます。つまり先に挙げた4ファイルをWindowsで使う場合にはcp932に、UNIXやLinuxで 使う場合にはeuc-jpに変換する必要があるのです。変換が必要だと予想される場合に は、辞書ファイルのビルドと同時に自動的に行なわれるようになっています。 - Migemo DLL配布ページ (cp932のmigemo-dictが入手可能) http://www.kaoriya.net/ - Ruby/Migemo (euc-jpのmigemo-dictが入手可能) http://migemo.namazu.org/ - SKK Openlab (最新のSKK-JISYO.Lが入手可能) http://openlab.ring.gr.jp/skk/index-j.html 型リファレンス {{{1 C/Migemoで利用される型について述べる。 - migemo*; Migemoオブジェクト。migemo_open()で作成され、migemo_close()で破棄される。 - int (*MIGEMO_PROC_CHAR2INT)(unsigned char*, unsigned int*); バイト列(unsigned char*)を文字コード(unsigned int)に変換するプロシージャ 型。Shift-JISやEUC-JP以外のエンコードの文字列を扱うとき、もしくは特殊文字 の処理を行いたいときに定義する。戻り値は文字列のうち処理したバイト数で、0 を返せばデフォルトのプロシージャが実行される。この仕組みで必要な文字だけに 処理を施すことが出来る。 - int (*MIGEMO_PROC_INT2CHAR)(unsigned int, unsigned char*); コード(unsigned int)をバイト列(unsigned char*)に変換するプロシージャ型。 Shift-JISやEUC-JP以外のエンコード文字列を扱うとき、もしくは特殊文字の処理 を行いたいときに定義する。戻り値は出力された文字列のバイト数で、0を返せば デフォルトのプロシージャが実行される。この仕組みで必要な文字だけに処理を施 すことが出来る。 関数リファレンス {{{1 C/Migemoライブラリで提供されるAPIを以下で解説する。実際の使用例はアーカイブ に含まれるmain.cを参照のこと。 - migemo* migemo_open(char* dict); Migemoオブジェクトを作成する。作成に成功するとオブジェクトが戻り値として返 り、失敗するとNULLが返る。dictで指定したファイルがmigemo-dict辞書としてオ ブジェクト作成時に読み込まれる。辞書と同じディレクトリに: 1. roma2hira.dat (ローマ字→平仮名変換表) 2. hira2kata.dat (平仮名→カタカナ変換表) 3. han2zen.dat (半角→全角変換表) という名前のファイルが存在すれば、存在したものだけが読み込まれる。dictに NULLを指定した場合には、辞書を含めていかなるファイルも読み込まれない。ファ イルはオブジェクト作成後にもmigemo_load()関数を使用することで追加読み込み ができる。 - void migemo_close(migemo* object); Migemoオブジェクトを破棄し、使用していたリソースを解放する。 - unsigned char* migemo_query(migemo* object, unsigned char* query); queryで与えられた文字列(ローマ字)を日本語検索のための正規表現へ変換する。 戻り値は変換された結果の文字列(正規表現)で、使用後はmigemo_release()関数へ 渡すことで解放しなければならない。 - void migemo_release(migemo* object, unsigned char* string); 使い終わったmigemo_query()関数で得られた正規表現を解放する。 - int migemo_load(migemo* obj, int dict_id, char* dict_file); Migemoオブジェクトに辞書、またはデータファイルを追加読み込みする。 dict_fileは読み込むファイル名を指定する。dict_idは読み込む辞書・データの種 類を指定するもので以下のうちどれか一つを指定する: MIGEMO_DICTID_MIGEMO mikgemo-dict辞書 MIGEMO_DICTID_ROMA2HIRA ローマ字→平仮名変換表 MIGEMO_DICTID_HIRA2KATA 平仮名→カタカナ変換表 MIGEMO_DICTID_HAN2ZEN 半角→全角変換表 戻り値は実際に読み込んだ種類を示し、上記の他に読み込みに失敗したことを示す 次の価が返ることがある。 MIGEMO_DICTID_INVALID - int migemo_is_enable(migemo* obj); Migemoオブジェクトにmigemo_dictが読み込めているかをチェックする。有効な migemo_dictを読み込めて内部に変換テーブルが構築できていれば0以外(TRUE)を、 構築できていないときには0(FALSE)を返す。 - int migemo_set_operator(migemo* object, int index, unsigned char* op); Migemoオブジェクトが生成する正規表現に使用するメタ文字(演算子)を指定する。 indexでどのメタ文字かを指定し、opで置き換える。indexには以下の値が指定可能 である: MIGEMO_OPINDEX_OR 論理和。デフォルトは "|" 。vimで利用する際は "\|" 。 MIGEMO_OPINDEX_NEST_IN グルーピングに用いる開き括弧。デフォルトは "(" 。vimではレジスタ\1〜\9 に記憶させないようにするために "\%(" を用いる。Perlでも同様のことを目 論むならば "(?:" が使用可能。 MIGEMO_OPINDEX_NEST_OUT グルーピングの終了を表す閉じ括弧。デフォルトでは ")" 。vimでは "\)" 。 MIGEMO_OPINDEX_SELECT_IN 選択の開始を表す開き角括弧。デフォルトでは "[" 。 MIGEMO_OPINDEX_SELECT_OUT 選択の終了を表す閉じ角括弧。デフォルトでは "]" 。 MIGEMO_OPINDEX_NEWLINE 各文字の間に挿入される「0個以上の空白もしくは改行にマッチする」パター ン。デフォルトでは "" であり設定されない。vimでは "\_s*" を指定する。 デフォルトのメタ文字は特に断りがない限りPerlのそれと同じ意味である。設定に 成功すると戻り値は1(0以外)となり、失敗すると0になる。 - const unsigned char* migemo_get_operator(migemo* object, int index); Migemoオブジェクトが生成する正規表現に使用しているメタ文字(演算子)を取得す る。indexについてはmigemo_set_operator()関数を参照。戻り値にはindexの指定 が正しければメタ文字を格納した文字列へのポインタが、不正であればNULLが返 る。 - void migemo_setproc_char2int(migemo* object, MIGEMO_PROC_CHAR2INT proc); Migemoオブジェクトにコード変換用のプロシージャを設定する。プロシージャにつ いての詳細は「型リファレンス」セクションのMIGEMO_PROC_CHAR2INTを参照。 - void migemo_setproc_int2char(migemo* object, MIGEMO_PROC_INT2CHAR proc); Migemoオブジェクトにコード変換用のプロシージャを設定する。プロシージャにつ いての詳細は「型リファレンス」セクションのMIGEMO_PROC_INT2CHARを参照。 コーディングサンプル {{{1 C/Migemoを利用したコーディング例を示す。以下のサンプルは一切のエラー処理を行 なっていないので、実際の利用時には注意が必要。 #include #inlcude "migemo.h" int main(int argc, char** argv) { migemo *m; /* C/Migemoの準備: 辞書読込にはエラー検出のためloadを推奨 */ m = migemo_open(NULL); migemo_load(m, MIGEMO_DICTID_MIGEMO, "./dict/migemo-dict"); /* 必要な回数だけqueryを行なう */ { unsigned char* p; p = migemo_query(m, "nezu"); printf("C/Migemo: %s\n", p); migemo_release(m, p); /* queryの結果は必ずreleaseする */ } /* 利用し終わったmigemoオブジェクトはcloseする */ migemo_close(m); return 0; } 更新箇所 {{{1 ● (1.2 正式版) 半角大文字を全角大文字に変換できないバグを修正 リリース用にドキュメントを修正 configureスクリプトを導入 Doxygenを導入する queryそのもので辞書を引くのを忘れていたのを修正 tools/Migemo.cs:体裁修正 ビルドディレクトリを変更(動作確認済:mvc,cyg,gcc,bc5) (1.1.023)migemo.c:EXPORTSの削除他 (1.1.022)dict/roma2hira.datに~→〜の変換を追加 (1.1.021)Windows用Makefileを修正 (1.1.020)romaji.cのテストコードを分離 (1.1.019)辞書読み込み時のエラーを不完全ながら厳密化 (1.1.018)roma2hira.datにヘボン式のm[bmp]及びtch[aiueo]を追加 (1.1.017)利用許諾条件を整理 (1.1.016)cmigemoをサブ辞書(ユーザ辞書)に対応 (1.1.015)cmigemo出力後にfflush()を追加 (1.1.014)MSVC用プロジェクトファイルをmsvc/以下へ移動 (1.1.013)cmigemoに--emacs/-e及び--nonewline/-nを追加 (1.1.012)mkpkgを改良 (1.1.011)dict/roma2hira.datに[bp]y[aiueo]のエントリを追加 (1.1.010)migemo.vimをcmigemoに対応(by.まっつんさん) (1.1.009)Solarisでコンパイルできるようにするための変更 (1.1.008)SKK辞書の配布形態変更に追従 (1.1.007)デバッグメッセージをコメントにより削除 (1.1.006)config.mkに設定例をコメントとして追加 (1.1.005)C#用サンプルtools/*.csを追加 (1.1.004)連文節に対応(β版扱い) (1.1.003)Solaris用メイクファイルMake_sun.makを追加、未動作チェック (1.1.002)辞書の1行に複数エントリを出力できなくなっていた問題を修正 (1.1.001)migemo.vimをUNIX系に対応 ● 27-May-2002 (1.1 正式版) 正式版リリース ドキュメントブラッシュアップ Makefile修正:releaseが./Releaseのためにビルドできなかった問題 ● 16-May-2002 (1.1-beta2) BC5対応のためブチ切れ寸前…(_ _;;; Makefileの構造変更(BC5対応のため) 謝辞追加 パッケージ作成用スクリプトの追加 cmigemoをプログラムから使いやすく。 ● 15-May-2002 (1.1-beta1) migemo_set_operator()の戻り値の意味を変更 ドキュメントブラッシュアップ Cygwin/MacOS X/Linux用にMakefileを作成 strip.plとlensort.plをtool/optimize-dict.plに統合 tool/conv.plをtool/skk2migemodict.plに名称変更 ドキュメント修正 cacheを最適化して高速化 (mnode_load()) wordbuf_add()を最適化して高速化 (wordbuf.c) migemo辞書読み込み失敗を検出できなくなっていたバグ修正 mnodeをまとめて確保することで高速化 (mnode.c他) 辞書を長さ降順にソート (tools/lensort.pl) 起動を1割から2割高速化 (mnode.c) ● 21-Aug-2001 main.cのgets()をfgets()に変更 }}} ------------------------------------------------------------------------------- 生きる事への強い意志が同時に自分と異なる生命をも尊ぶ心となる MURAOKA Taro/村岡太郎 vi:set ts=8 sts=2 sw=2 tw=78 et fdm=marker ft=memo: cmigemo-1.2+gh0.20140306/doc/TODO_j.txt000066400000000000000000000022071230636573300167410ustar00rootroot00000000000000 vim:set ts=8 sts=4 sw=4 tw=0 ft=memo: Last Change: 29-Oct-2003. TODO 辞書ファイル作成作業をPerl非依存にする エスケープする文字をカスタマイズ可能にする もしくは各種言語用の出力を用意する ローマ字変換に「ステート残り」を導入 辞書ファイル毎にmtreeを作成し、ランタイムで切り離せるようにする テストsuiteを作成する ドキュメント(Doxygen)を充実 ONICE 1.1 ローマ字変換でマルチバイト文字を考慮(Vim掲示板:1281) DONE 1.1 GCC用Makefile修正 Doxygenを導入する Cygwinでbuild/cygmigemo1.dllに依存してしまうのを修正 queryそのもので辞書を引くのを忘れていたのを修正 Windows用Makefileを修正 romaji.cのテストコードを分離(testdir/romaji_main.c) roma2hira.datにヘボン式のm[bmp]及びtch[aiueo]を追加 ライセンスをハッキリさせる cmigemoにサブ辞書(ユーザ辞書)機能を追加 query毎にfflush() サンプルプログラムのヘルプもしくはドキュメント追加作成 ドキュメントにContributorの記述を追加 UNIX用Makefile一式をインクルード wordbuf_add()とmnode_load()の高速化 mnodeをまとめて確保するように変更(辞書読み込みの高速化) 辞書を効率よく読み込むためのソート方法判明→長い単語を先頭へ 1割程度の高速化 cmigemo-1.2+gh0.20140306/doc/doxygen.conf000066400000000000000000001251021230636573300174460ustar00rootroot00000000000000# Doxyfile 1.3.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = C/Migemo # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 1.2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doc # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en # (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = Japanese # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = YES # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. It is allowed to use relative paths in the argument list. STRIP_FROM_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explict @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # reimplements. INHERIT_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = src # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp # *.h++ *.idl *.odl *.cs *.php *.php3 *.inc FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories # that are symbolic links (a Unix filesystem feature) are excluded from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output dir. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimised for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assigments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse the # parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::addtions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or # super classes. Setting the tag to NO turns the diagrams off. Note that this # option is superceded by the HAVE_DOT option below. This is only a fallback. It is # recommended to install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similiar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found on the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes that # lay further from the root node will be omitted. Note that setting this option to # 1 or 2 may greatly reduce the computation time needed for large code bases. Also # note that a graph may be further truncated if the graph's image dimensions are # not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). # If 0 is used for the depth value (the default), the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::addtions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO cmigemo-1.2+gh0.20140306/doc/vimigemo.txt000066400000000000000000000076711230636573300175110ustar00rootroot00000000000000Migemo DLL説明書/Vimにおける使用方法 Since: 14-Aug-2001 Version: 1.0 Author: MURAOKA Taro (KoRoN) Last Change: 16-Dec-2003. 説明 Migemo DLLはローマ字入力を日本語検索の正規表現に変換するライブラリです。これ によりライブラリのクライアント(ソフトウェア)は「ローマ字のまま日本語を(イン クリメンタルに)検索する」機能を持つことが可能になります。 元々MigemoとはEmacs用にRubyとLispで書かれたモジュールでした(Ruby/Migemo)。こ れをVimに組み込むにあたり、より汎用性を持たせるために、村岡がライブラリの形 でC言語により再実装しました(C/Migemo)。このC/MigemoをDLLとしてコンパイルした ものがMigemo DLLです。 このDLLをVim(6.0ar以降)で使用してVim上で「ローマ字のまま日本語を(インクリメ ンタルに)検索する」方法を解説します。 - 本家Ruby/Migemo (Migemoに関する詳細) http://migemo.namazu.org/ - Vim日本語版情報 (C/Migemo情報有) http://www.kaoriya.net/ - Vim掲示板 http://www.kaoriya.net/bbs/bbs.cgi インストール手順 以下の説明ではVimをインストールした(gvim.exeの置いてある)ディレクトリを$VIM と表記しています。必要ならば各自の環境に読み替えてください。 1. migemo.dllをインストールする migemo.dllをgvim.exeと同じディレクトリに置きます。同じディレクトリでなくて も環境変数PATHに含まれる場所のどれかであれば構いません。 2. スクリプト(migemo.vim)をインストールする runtime/plugin/migemo.vimを$VIM/runtime/plugin/に置きます。この作業は同梱 のruntimeディレクトリを$VIMへ上書きコピーすれば完了できます。関係の無い ファイルはまったく触らず上書きできますので安心して上書きコピーしてくださ い。その他、個人ディレクトリvimfiles/pluginに置くこともできます。 3. 辞書ファイルをインストールする $VIM/dictというディレクトリを作り、migemo-dict、roma2hira.dat、han2zen.dat そしてhira2kata.datを置きます。この作業は同梱のdictディレクトリを$VIMへ上 書きコピーすれば完了できます。関係の無いファイルはまったく触らず上書きでき ますので安心して上書きコピーしてください。 つまりのアーカイブに含まれる全てのファイルとディレクトリを$VIMへコピーすれば インストールは完了します。 使用方法 ライブラリ(DLL)と辞書それにスクリプトをインストールすれば(この時'incsearch' はもちろん有効になっているものと考えています) g/がMigemoによる検索の開始に マップされます。ただし初回の検索時に限り、結果が出るのに少々時間がかかりま す。これは大きな辞書の読み込みに時間がかかっているためです。 g?についてはVimの:help rot13の機能と衝突するため、デフォルトの状態では利用で きません。g?をMigemoによる拡張検索にマップしたい場合は :set migemo してください。 利用許諾条件 doc/LICENSE_j.txt 辞書の著作権・利用許諾条件 Migemo DLLで利用する辞書の諸権利、利用許諾条件及び著作権等はその辞書の定める ところに従います。Migemo DLLはSKK辞書を用いるように初期設定されていますが、 SKK辞書の利用許諾条件はMigemo DLLのそれとは法的に別であることに注意してくだ さい。 質問・連絡先 Migemo DLLに関する質問・要望等は村岡(下記アドレス参照)まで連絡してください。ソ フトウェアからMigemo DLLを使用したい場合の問い合わせも受け付けます。 謝辞 Migemoを発案されRuby/Migemoを作成され、C/Migemoについての相談にMLで親切に答 えていただいた高林 哲さんに感謝いたします。また、この配布パッケージには以下 の方々によるドキュメントやアイデアが含まれています。ありがとうございます。 (アルファベット順) - MATSUMOTO Yasuhiro migemo.vimをcmigemoに対応 更新箇所 ● 16-Dec-2003 C/Migemo 1.2 ドキュメント修正 ● 27-May-2002 C/Migemo 1.1と再パッケージ ● 08-Sep-2001 プラグインでhas('migemo')をチェックするように変更 ● 14-Aug-2001 初版リリース ------------------------------------------------------------------------------- 生きる事への強い意志が同時に自分と異なる生命をも尊ぶ心となる Muraoka Taro/村岡太郎 vim:set ts=8 sts=2 sw=2 tw=78 et ft=memo: cmigemo-1.2+gh0.20140306/mkpkg000066400000000000000000000023541230636573300154140ustar00rootroot00000000000000#!/bin/csh # vim:set ts=8 sts=2 sw=2 tw=0: # # Last Change: 17-Jan-2003. # Written By: MURAOKA Taro set pkgname = "cmigemo" set pkgverex = "" if ($1 != '') then set pkgver = "$1" else if (-e VERSION) then set pkgver = `cat VERSION` else echo "" echo "Please specify package version string." echo "Example: './mkpkg 1.0-xxx '" exit endif if (-e CVS/Root) then set cvsroot = `cat CVS/Root` else set cvsroot = ':pserver:anonymous@cvs.kaoriya.net:/anonycvs' endif if (-e CVS/Repository) then set cvsrepository = `cat CVS/Repository` else if (-e .cvsrepository) set cvsrepository = `cat .cvsrepository` else set cvsrepository = 'unknown' endif if (-e CVS/Revision) then set cvsrevision = `cat CVS/Revision` else set cvsrevision = '-D now' endif set pkgdir = "${pkgname}-${pkgver}${pkgverex}" echo "${pkgdir}: " cd .. rm -rf "$pkgdir" echo -n " Making package dir ..." cvs -d $cvsroot -Q export $cvsrevision -d $pkgdir $cvsrepository echo "finish" echo -n " Archiving ..." tar cf "${pkgdir}.tar" "$pkgdir" echo "finish" echo -n " Compressing ..." bzip2 -f "${pkgdir}.tar" echo "finish" echo "" rm -rf "$pkgdir" if ("$version" =~ *Win*) then start . else if ("$version" =~ *darwin*) then open . endif cmigemo-1.2+gh0.20140306/msvc/000077500000000000000000000000001230636573300153245ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/msvc/.cvsignore000066400000000000000000000000761230636573300173270ustar00rootroot00000000000000*.lib *.tds Profile cmigemo libmigemo*dylib libmigemo.so* tmp cmigemo-1.2+gh0.20140306/msvc/clean.bat000077500000000000000000000001531230636573300171000ustar00rootroot00000000000000@echo off del /F /Q *.opt del /F /Q *.ncb del /F /Q *.plg rd /S /Q Debug rd /S /Q Profile rd /S /Q Release cmigemo-1.2+gh0.20140306/msvc/dbg_migemo.dsp000066400000000000000000000071721230636573300201340ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dbg_migemo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** 編集しないでください ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=dbg_migemo - Win32 Debug !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください !MESSAGE !MESSAGE NMAKE /f "dbg_migemo.mak". !MESSAGE !MESSAGE NMAKE の実行時に構成を指定できます !MESSAGE コマンド ライン上でマクロの設定を定義します。例: !MESSAGE !MESSAGE NMAKE /f "dbg_migemo.mak" CFG="dbg_migemo - Win32 Debug" !MESSAGE !MESSAGE 選択可能なビルド モード: !MESSAGE !MESSAGE "dbg_migemo - Win32 Debug" ("Win32 (x86) Console Application" 用) !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "dbg_migemo___Win32_Debug" # PROP BASE Intermediate_Dir "dbg_migemo___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug\standalone" # PROP Intermediate_Dir "Debug\standalone" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "FULL_LINK_TEST" /YX /FD /GZ /c # ADD BASE RSC /l 0x411 /d "_DEBUG" # ADD RSC /l 0x411 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # Begin Target # Name "dbg_migemo - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\filename.c # End Source File # Begin Source File SOURCE=..\main.c # End Source File # Begin Source File SOURCE=..\migemo.c # End Source File # Begin Source File SOURCE=..\mnode.c # End Source File # Begin Source File SOURCE=..\romaji.c # End Source File # Begin Source File SOURCE=..\rxgen.c # End Source File # Begin Source File SOURCE=..\wordbuf.c # End Source File # Begin Source File SOURCE=..\wordlist.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\dbg.h # End Source File # Begin Source File SOURCE=..\filename.h # End Source File # Begin Source File SOURCE=..\migemo.h # End Source File # Begin Source File SOURCE=..\mnode.h # End Source File # Begin Source File SOURCE=..\resource.h # End Source File # Begin Source File SOURCE=..\romaji.h # End Source File # Begin Source File SOURCE=..\rxgen.h # End Source File # Begin Source File SOURCE=..\wordbuf.h # End Source File # Begin Source File SOURCE=..\wordlist.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project cmigemo-1.2+gh0.20140306/msvc/dll_migemo.dsp000066400000000000000000000117051230636573300201500ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dll_migemo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** 編集しないでください ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=dll_migemo - Win32 Debug !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください !MESSAGE !MESSAGE NMAKE /f "dll_migemo.mak". !MESSAGE !MESSAGE NMAKE の実行時に構成を指定できます !MESSAGE コマンド ライン上でマクロの設定を定義します。例: !MESSAGE !MESSAGE NMAKE /f "dll_migemo.mak" CFG="dll_migemo - Win32 Debug" !MESSAGE !MESSAGE 選択可能なビルド モード: !MESSAGE !MESSAGE "dll_migemo - Win32 Release" ("Win32 (x86) Dynamic-Link Library" 用) !MESSAGE "dll_migemo - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" 用) !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "dll_migemo - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLL_MIGEMO_EXPORTS" /YX /FD /c # ADD CPP /nologo /G6 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLL_MIGEMO_EXPORTS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x411 /d "NDEBUG" # ADD RSC /l 0x411 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /map /machine:I386 /out:"Release/migemo.dll" !ELSEIF "$(CFG)" == "dll_migemo - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLL_MIGEMO_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DLL_MIGEMO_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x411 /d "_DEBUG" # ADD RSC /l 0x411 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/migemo.dll" /pdbtype:sept !ENDIF # Begin Target # Name "dll_migemo - Win32 Release" # Name "dll_migemo - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\filename.c # End Source File # Begin Source File SOURCE=..\migemo.c # End Source File # Begin Source File SOURCE=..\migemo.def # End Source File # Begin Source File SOURCE=..\mnode.c # End Source File # Begin Source File SOURCE=..\romaji.c # End Source File # Begin Source File SOURCE=..\rxgen.c # End Source File # Begin Source File SOURCE=..\wordbuf.c # End Source File # Begin Source File SOURCE=..\wordlist.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\dbg.h # End Source File # Begin Source File SOURCE=..\filename.h # End Source File # Begin Source File SOURCE=..\migemo.h # End Source File # Begin Source File SOURCE=..\mnode.h # End Source File # Begin Source File SOURCE=..\resource.h # End Source File # Begin Source File SOURCE=..\romaji.h # End Source File # Begin Source File SOURCE=..\rxgen.h # End Source File # Begin Source File SOURCE=..\wordbuf.h # End Source File # Begin Source File SOURCE=..\wordlist.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project cmigemo-1.2+gh0.20140306/msvc/migemo.dsp000066400000000000000000000106151230636573300173140ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="migemo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** 編集しないでください ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=migemo - Win32 Release !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください !MESSAGE !MESSAGE NMAKE /f "migemo.mak". !MESSAGE !MESSAGE NMAKE の実行時に構成を指定できます !MESSAGE コマンド ライン上でマクロの設定を定義します。例: !MESSAGE !MESSAGE NMAKE /f "migemo.mak" CFG="migemo - Win32 Release" !MESSAGE !MESSAGE 選択可能なビルド モード: !MESSAGE !MESSAGE "migemo - Win32 Release" ("Win32 (x86) Console Application" 用) !MESSAGE "migemo - Win32 Debug" ("Win32 (x86) Console Application" 用) !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "migemo - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_SPLITED_MIGEMO" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x411 /d "NDEBUG" # ADD RSC /l 0x411 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/cmigemo.exe" !ELSEIF "$(CFG)" == "migemo - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_SPLITED_MIGEMO" /YX /FD /GZ /c # ADD BASE RSC /l 0x411 /d "_DEBUG" # ADD RSC /l 0x411 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 /out:"Debug/cmigemo.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "migemo - Win32 Release" # Name "migemo - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\main.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\dbg.h # End Source File # Begin Source File SOURCE=..\migemo.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project cmigemo-1.2+gh0.20140306/msvc/migemo.dsw000066400000000000000000000021771230636573300173270ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # 警告: このワークスペース ファイル を編集または削除しないでください! ############################################################################### Project: "dbg_migemo"=.\dbg_migemo.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "dll_migemo"=.\dll_migemo.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "migemo"=.\migemo.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dll_migemo End Project Dependency }}} ############################################################################### Project: "prof_migemo"=.\prof_migemo.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### cmigemo-1.2+gh0.20140306/msvc/prof_migemo.dsp000066400000000000000000000071611230636573300203440ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="prof_migemo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** 編集しないでください ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=prof_migemo - Win32 Profile !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください !MESSAGE !MESSAGE NMAKE /f "prof_migemo.mak". !MESSAGE !MESSAGE NMAKE の実行時に構成を指定できます !MESSAGE コマンド ライン上でマクロの設定を定義します。例: !MESSAGE !MESSAGE NMAKE /f "prof_migemo.mak" CFG="prof_migemo - Win32 Profile" !MESSAGE !MESSAGE 選択可能なビルド モード: !MESSAGE !MESSAGE "prof_migemo - Win32 Profile" ("Win32 (x86) Console Application" 用) !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Profile" # PROP BASE Intermediate_Dir "Profile" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Profile" # PROP Intermediate_Dir "Profile" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "_NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_PROFILE" /FD /c # ADD BASE RSC /l 0x411 /d "_DEBUG" # ADD RSC /l 0x411 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /profile /map /machine:I386 # SUBTRACT LINK32 /debug # Begin Target # Name "prof_migemo - Win32 Profile" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\filename.c # End Source File # Begin Source File SOURCE=..\main.c # End Source File # Begin Source File SOURCE=..\migemo.c # End Source File # Begin Source File SOURCE=..\mnode.c # End Source File # Begin Source File SOURCE=..\romaji.c # End Source File # Begin Source File SOURCE=..\rxgen.c # End Source File # Begin Source File SOURCE=..\wordbuf.c # End Source File # Begin Source File SOURCE=..\wordlist.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\dbg.h # End Source File # Begin Source File SOURCE=..\filename.h # End Source File # Begin Source File SOURCE=..\migemo.h # End Source File # Begin Source File SOURCE=..\mnode.h # End Source File # Begin Source File SOURCE=..\resource.h # End Source File # Begin Source File SOURCE=..\romaji.h # End Source File # Begin Source File SOURCE=..\rxgen.h # End Source File # Begin Source File SOURCE=..\wordbuf.h # End Source File # Begin Source File SOURCE=..\wordlist.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project cmigemo-1.2+gh0.20140306/src/000077500000000000000000000000001230636573300151435ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/src/dbg.h000066400000000000000000000011561230636573300160530ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ #if defined(_MSC_VER) && !defined(ANSI_DEBUG) # include #else # include # ifdef _DEBUG # define _ASSERT(x) assert(x) # define _CRT_WARN stderr # define _RPT0(f,s) fprintf(f,s) # define _RPT1(f,s,a1) fprintf(f,s,a1) # define _RPT2(f,s,a1,a2) fprintf(f,s,a1,a2) # define _RPT3(f,s,a1,a2,a3) fprintf(f,s,a1,a2,a3) # define _RPT4(f,s,a1,a2,a3,a4) fprintf(f,s,a1,a2,a3,a4) # else # define _ASSERT(x) # define _RPT0(f,s) # define _RPT1(f,s,a1) # define _RPT2(f,s,a1,a2) # define _RPT3(f,s,a1,a2,a3) # define _RPT4(f,s,a1,a2,a3,a4) # endif #endif cmigemo-1.2+gh0.20140306/src/depend.mak000066400000000000000000000025431230636573300171000ustar00rootroot00000000000000# vim:set ts=8 sts=8 sw=8 tw=0: # # 構成ファイルと依存関係 # # Last Change: 18-Oct-2003. # Written By: MURAOKA Taro ############################################################################## # 構成ファイル # SRC = $(srcdir)filename.c \ $(srcdir)migemo.c \ $(srcdir)mnode.c \ $(srcdir)romaji.c \ $(srcdir)rxgen.c \ $(srcdir)wordbuf.c \ $(srcdir)wordlist.c OBJ = $(objdir)filename.$(O) \ $(objdir)migemo.$(O) \ $(objdir)mnode.$(O) \ $(objdir)romaji.$(O) \ $(objdir)rxgen.$(O) \ $(objdir)wordbuf.$(O) \ $(objdir)wordlist.$(O) ############################################################################## # 依存関係の設定 # $(objdir)filename.$(O): $(srcdir)filename.c \ $(srcdir)filename.h $(objdir)main.$(O): $(srcdir)main.c \ $(srcdir)migemo.h $(objdir)migemo.$(O): $(srcdir)migemo.c \ $(srcdir)filename.h \ $(srcdir)wordbuf.h \ $(srcdir)wordlist.h \ $(srcdir)mnode.h \ $(srcdir)rxgen.h \ $(srcdir)romaji.h \ $(srcdir)migemo.h $(objdir)mnode.$(O): $(srcdir)mnode.c \ $(srcdir)dbg.h \ $(srcdir)wordbuf.h \ $(srcdir)wordlist.h \ $(srcdir)mnode.h $(objdir)romaji.$(O): $(srcdir)romaji.c \ $(srcdir)romaji.h $(objdir)rxgen.$(O): $(srcdir)rxgen.c \ $(srcdir)wordbuf.h \ $(srcdir)rxgen.h $(objdir)wordbuf.$(O): $(srcdir)wordbuf.c \ $(srcdir)wordbuf.h $(objdir)wordlist.$(O): $(srcdir)wordlist.c \ $(srcdir)wordlist.h cmigemo-1.2+gh0.20140306/src/filename.c000066400000000000000000000051171230636573300170730ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * filename.c - Operate filename. * * Last change: 15-May-2002. * Written by: Muraoka Taro */ #include /* * Cut out base string of filename from filepath. If base is NULL, then * return length that require for store base name. */ int filename_base(char *base, const char *path) { int i; int len = strlen(path) - 1; int end; for (i = len; i >= 0; --i) if (path[i] == '.') break; if (i <= 0) end = len; else end = i - 1; for (i = end; i >= 0; --i) if (path[i] == '\\' || path[i] == '/') { ++i; break; } if (i < 0) ++i; len = end - i + 1; if (base) { strncpy(base, path + i, len); base[len] = '\0'; } return len; } /* * Cut out directroy string from filepath. If dir is NULL, then return * length that require for store directory. */ int filename_directory(char *dir, const char *path) { int i; for (i = strlen(path) - 1; i >= 0; --i) if (path[i] == '\\' || path[i] == '/') break; if (i <= 0) { if (dir) dir[0] = '\0'; return 0; } if (dir) { strncpy(dir, path, i + 1); dir[i] = '\0'; } return i; } /* * Cut out extension of filename or filepath. If ext is NULL, then return * length that require for store extension. */ int filename_extension(char *ext, const char *path) { int i; int len = strlen(path); for (i = len - 1; i >= 0; --i) if (path[i] == '.') break; if (i < 0 || i == len - 1) { ext[0] = '\0'; return 0; } len -= ++i; if (ext) strcpy(ext, path + i); return len; } /* * Cut out filename string from filepath. If name is NULL, then return * length that require for store directory. */ int filename_filename(char *name, const char *path) { int i; int len = strlen(path); for (i = len - 1; i >= 0; --i) if (path[i] == '\\' || path[i] == '/') break; ++i; len -= i; if (name) { strncpy(name, path + i, len); name[len] = '\0'; } return len; } /* * Generate file full path name. */ int filename_generate(char *filepath, const char *dir, const char *base, const char *ext) { int len = 0; if (filepath) filepath[0] = '\0'; if (dir) { if (filepath) { strcat(filepath, dir); strcat(filepath, "/"); } len += strlen(dir) + 1; } if (base) { if (filepath) strcat(filepath, base); len += strlen(base); } if (ext) { if (filepath) { strcat(filepath, "."); strcat(filepath, ext); } len += 1 + strlen(ext); } return len; } cmigemo-1.2+gh0.20140306/src/filename.h000066400000000000000000000011211230636573300170670ustar00rootroot00000000000000/* vi:set ts=8 sts=4 sw=4 tw=0: */ /* * filename.h - Operate filename. * * Last change: 15-May-2002. * Written by: Muraoka Taro */ #ifndef FILENAME_H #define FILENAME_H #ifdef __cplusplus extern "C" { #endif int filename_base(char *base, const char *path); int filename_directory(char *dir, const char *path); int filename_extension(char *ext, const char *path); int filename_filename(char *name, const char *path); int filename_generate(char *filepath, const char *dir, const char *base, const char *ext); #ifdef __cplusplus } #endif #endif /* FILENAME_H */ cmigemo-1.2+gh0.20140306/src/main.c000066400000000000000000000122031230636573300162310ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * main.c - migemoライブラリテストドライバ * * Written By: MURAOKA Taro * Last Change: 11-Oct-2003. */ #include #include #include #include #include "migemo.h" #define MIGEMO_ABOUT "cmigemo - C/Migemo Library " MIGEMO_VERSION " Driver" #define MIGEMODICT_NAME "migemo-dict" #define MIGEMO_SUBDICT_MAX 8 /* * main */ int query_loop(migemo* p, int quiet) { while (!feof(stdin)) { unsigned char buf[256], *ans; if (!quiet) printf("QUERY: "); /* gets()を使っていたがfgets()に変更 */ if (!fgets(buf, sizeof(buf), stdin)) { if (!quiet) printf("\n"); break; } /* 改行をNUL文字に置き換える */ if ((ans = strchr(buf, '\n')) != NULL) *ans = '\0'; ans = migemo_query(p, buf); if (ans) printf(quiet ? "%s\n" : "PATTERN: %s\n", ans); fflush(stdout); migemo_release(p, ans); } return 0; } static void help(char* prgname) { printf( "\ %s \n\ \n\ USAGE: %s [OPTIONS]\n\ \n\ OPTIONS:\n\ -d --dict Use a file for dictionary.\n\ -s --subdict Sub dictionary files. (MAX %d times)\n \ -q --quiet Show no message except results.\n\ -v --vim Use vim style regexp.\n\ -e --emacs Use emacs style regexp.\n\ -n --nonewline Don't use newline match.\n\ -w --word Expand a and soon exit.\n\ -h --help Show this message.\n\ " , MIGEMO_ABOUT, prgname, MIGEMO_SUBDICT_MAX); exit(0); } int main(int argc, char** argv) { int mode_vim = 0; int mode_emacs = 0; int mode_nonewline = 0; int mode_quiet = 0; char* dict = NULL; char* subdict[MIGEMO_SUBDICT_MAX]; int subdict_count = 0; migemo *pmigemo; FILE *fplog = stdout; char *word = NULL; char *prgname = argv[0]; memset(subdict, 0, sizeof(subdict)); while (*++argv) { if (0) ; else if (!strcmp("--vim", *argv) || !strcmp("-v", *argv)) mode_vim = 1; else if (!strcmp("--emacs", *argv) || !strcmp("-e", *argv)) mode_emacs = 1; else if (!strcmp("--nonewline", *argv) || !strcmp("-n", *argv)) mode_nonewline = 1; else if (argv[1] && (!strcmp("--dict", *argv) || !strcmp("-d", *argv))) dict = *++argv; else if (argv[1] && (!strcmp("--subdict", *argv) || !strcmp("-s", *argv)) && subdict_count < MIGEMO_SUBDICT_MAX) subdict[subdict_count++] = *++argv; else if (argv[1] && (!strcmp("--word", *argv) || !strcmp("-w", *argv))) word = *++argv; else if (!strcmp("--quiet", *argv) || !strcmp("-q", *argv)) mode_quiet = 1; else if (!strcmp("--help", *argv) || !strcmp("-h", *argv)) help(prgname); } #ifdef _PROFILE fplog = fopen("exe.log", "wt"); #endif /* 辞書をカレントディレクトリと1つ上のディレクトリから捜す */ if (!dict) { pmigemo = migemo_open("./dict/" MIGEMODICT_NAME); if (!word && !mode_quiet) { fprintf(fplog, "migemo_open(\"%s\")=%p\n", "./dict/" MIGEMODICT_NAME, pmigemo); } if (!pmigemo || !migemo_is_enable(pmigemo)) { migemo_close(pmigemo); /* NULLをcloseしても問題はない */ pmigemo = migemo_open("../dict/" MIGEMODICT_NAME); if (!word && !mode_quiet) { fprintf(fplog, "migemo_open(\"%s\")=%p\n", "../dict/" MIGEMODICT_NAME, pmigemo); } } } else { pmigemo = migemo_open(dict); if (!word && !mode_quiet) fprintf(fplog, "migemo_open(\"%s\")=%p\n", dict, pmigemo); } /* サブ辞書を読み込む */ if (subdict_count > 0) { int i; for (i = 0; i < subdict_count; ++i) { int result; if (subdict[i] == NULL || subdict[i][0] == '\0') continue; result = migemo_load(pmigemo, MIGEMO_DICTID_MIGEMO, subdict[i]); if (!word && !mode_quiet) fprintf(fplog, "migemo_load(%p, %d, \"%s\")=%d\n", pmigemo, MIGEMO_DICTID_MIGEMO, subdict[i], result); } } if (!pmigemo) return 1; else { if (mode_vim) { migemo_set_operator(pmigemo, MIGEMO_OPINDEX_OR, "\\|"); migemo_set_operator(pmigemo, MIGEMO_OPINDEX_NEST_IN, "\\%("); migemo_set_operator(pmigemo, MIGEMO_OPINDEX_NEST_OUT, "\\)"); if (!mode_nonewline) migemo_set_operator(pmigemo, MIGEMO_OPINDEX_NEWLINE, "\\_s*"); } else if (mode_emacs) { migemo_set_operator(pmigemo, MIGEMO_OPINDEX_OR, "\\|"); migemo_set_operator(pmigemo, MIGEMO_OPINDEX_NEST_IN, "\\("); migemo_set_operator(pmigemo, MIGEMO_OPINDEX_NEST_OUT, "\\)"); if (!mode_nonewline) migemo_set_operator(pmigemo, MIGEMO_OPINDEX_NEWLINE, "\\s-*"); } #ifndef _PROFILE if (word) { unsigned char *ans; ans = migemo_query(pmigemo, word); if (ans) fprintf(fplog, mode_vim ? "%s" : "%s\n", ans); migemo_release(pmigemo, ans); } else { if (!mode_quiet) printf("clock()=%f\n", (float)clock() / CLOCKS_PER_SEC); query_loop(pmigemo, mode_quiet); } #else /* プロファイル用 */ { unsigned char *ans; ans = migemo_query(pmigemo, "a"); if (ans) fprintf(fplog, " [%s]\n", ans); migemo_release(pmigemo, ans); ans = migemo_query(pmigemo, "k"); if (ans) fprintf(fplog, " [%s]\n", ans); migemo_release(pmigemo, ans); } #endif migemo_close(pmigemo); } if (fplog != stdout) fclose(fplog); return 0; } cmigemo-1.2+gh0.20140306/src/migemo.c000066400000000000000000000333001230636573300165630ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * migemo.c - * * Written By: Muraoka Taro * Last Change: 29-Dec-2003. */ #include #include #include #include #include "wordbuf.h" #include "wordlist.h" #include "mnode.h" #include "rxgen.h" #include "romaji.h" #include "filename.h" #include "migemo.h" #define DICT_MIGEMO "migemo-dict" #define DICT_ROMA2HIRA "roma2hira.dat" #define DICT_HIRA2KATA "hira2kata.dat" #define DICT_HAN2ZEN "han2zen.dat" #define VOWELS_STRING "aiueo" #ifdef __BORLANDC__ # define EXPORTS __declspec(dllexport) #else # define EXPORTS #endif typedef int (*MIGEMO_PROC_ADDWORD)(void* data, unsigned char* word); /* migemoオブジェクト */ struct _migemo { int enable; mtree_p mtree; romaji* roma2hira; romaji* hira2kata; romaji* han2zen; rxgen* rx; MIGEMO_PROC_ADDWORD addword; }; /* * migemo interfaces */ static mtree_p load_mtree_dictionary(mtree_p mtree, char* dict_file) { FILE *fp; if ((fp = fopen(dict_file, "rt")) == NULL) return NULL; /* Can't find file */ mtree = mnode_load(mtree, fp); fclose(fp); return mtree; } /** * Migemoオブジェクトに辞書、またはデータファイルを追加読み込みする。 * dict_fileは読み込むファイル名を指定する。dict_idは読み込む辞書・データの * 種類を指定するもので以下のうちどれか一つを指定する: * *
*
MIGEMO_DICTID_MIGEMO
*
mikgemo-dict辞書
*
MIGEMO_DICTID_ROMA2HIRA
*
ローマ字→平仮名変換表
*
MIGEMO_DICTID_HIRA2KATA
*
平仮名→カタカナ変換表
*
MIGEMO_DICTID_HAN2ZEN
*
半角→全角変換表
*
* * 戻り値は実際に読み込んだ種類を示し、上記の他に読み込みに失敗したことを示す * 次の価が返ることがある。 * *
MIGEMO_DICTID_INVALID
* @param obj Migemoオブジェクト * @param dict_id 辞書ファイルの種類 * @param dict_file 辞書ファイルのパス */ EXPORTS int migemo_load(migemo* obj, int dict_id, char* dict_file) { if (!obj && dict_file) return MIGEMO_DICTID_INVALID; if (dict_id == MIGEMO_DICTID_MIGEMO) { /* migemo辞書読み込み */ mtree_p mtree; if ((mtree = load_mtree_dictionary(obj->mtree, dict_file)) == NULL) return MIGEMO_DICTID_INVALID; obj->mtree = mtree; obj->enable = 1; return dict_id; /* Loaded successfully */ } else { romaji *dict; switch (dict_id) { case MIGEMO_DICTID_ROMA2HIRA: /* ローマ字辞書読み込み */ dict = obj->roma2hira; break; case MIGEMO_DICTID_HIRA2KATA: /* カタカナ辞書読み込み */ dict = obj->hira2kata; break; case MIGEMO_DICTID_HAN2ZEN: /* 半角→全角辞書読み込み */ dict = obj->han2zen; break; default: dict = NULL; break; } if (dict && romaji_load(dict, dict_file) == 0) return dict_id; else return MIGEMO_DICTID_INVALID; } } /** * Migemoオブジェクトを作成する。作成に成功するとオブジェクトが戻り値として * 返り、失敗するとNULLが返る。dictで指定したファイルがmigemo-dict辞書として * オブジェクト作成時に読み込まれる。辞書と同じディレクトリに: * *
*
roma2hira.dat
*
ローマ字→平仮名変換表
*
hira2kata.dat
*
平仮名→カタカナ変換表
*
han2zen.dat
*
半角→全角変換表
*
* * という名前のファイルが存在すれば、存在したものだけが読み込まれる。dictに * NULLを指定した場合には、辞書を含めていかなるファイルも読み込まれない。 * ファイルはオブジェクト作成後にもmigemo_load()関数を使用することで追加読み * 込みができる。 * @param dict migemo-dict辞書のパス。NULLの時は辞書を読み込まない。 * @returns 作成されたMigemoオブジェクト */ EXPORTS migemo* migemo_open(char* dict) { migemo *obj; /* migemoオブジェクトと各メンバを構築 */ if (!(obj = (migemo*)malloc(sizeof(migemo)))) return obj; obj->enable = 0; obj->mtree = mnode_open(NULL); obj->rx = rxgen_open(); obj->roma2hira = romaji_open(); obj->hira2kata = romaji_open(); obj->han2zen = romaji_open(); if (!obj->rx || !obj->roma2hira || !obj->hira2kata || !obj->han2zen) { migemo_close(obj); return obj = NULL; } /* デフォルトmigemo辞書が指定されていたらローマ字とカタカナ辞書も探す */ if (dict) { #ifndef _MAX_PATH # define _MAX_PATH 1024 /* いい加減な数値 */ #endif char dir[_MAX_PATH]; char roma_dict[_MAX_PATH], kata_dict[_MAX_PATH], h2z_dict[_MAX_PATH]; char *tmp; mtree_p mtree; filename_directory(dir, dict); tmp = strlen(dir) ? dir : "."; strcpy(roma_dict, tmp); strcpy(kata_dict, tmp); strcpy(h2z_dict, tmp); strcat(roma_dict, "/" DICT_ROMA2HIRA); strcat(kata_dict, "/" DICT_HIRA2KATA); strcat(h2z_dict, "/" DICT_HAN2ZEN); mtree = load_mtree_dictionary(obj->mtree, dict); if (mtree) { obj->mtree = mtree; obj->enable = 1; romaji_load(obj->roma2hira, roma_dict); romaji_load(obj->hira2kata, kata_dict); romaji_load(obj->han2zen, h2z_dict); } } return obj; } /** * Migemoオブジェクトを破棄し、使用していたリソースを解放する。 * @param obj 破棄するMigemoオブジェクト */ EXPORTS void migemo_close(migemo* obj) { if (obj) { if (obj->han2zen) romaji_close(obj->han2zen); if (obj->hira2kata) romaji_close(obj->hira2kata); if (obj->roma2hira) romaji_close(obj->roma2hira); if (obj->rx) rxgen_close(obj->rx); if (obj->mtree) mnode_close(obj->mtree); free(obj); } } /* * query version 2 */ /* * mnodeの持つ単語リストを正規表現生成エンジンに入力する。 */ static void migemo_query_proc(mnode* p, void* data) { migemo *object = (migemo*)data; wordlist_p list = p->list; for (; list; list = list->next) object->addword(object, list->ptr); } /* * バッファを用意してmnodeに再帰で書き込ませる */ static void add_mnode_query(migemo* object, unsigned char* query) { mnode *pnode; if ((pnode = mnode_query(object->mtree, query)) != NULL) mnode_traverse(pnode, migemo_query_proc, object); } static int add_roma(migemo* object, unsigned char* query) { unsigned char *stop, *hira, *kata; hira = romaji_convert(object->roma2hira, query, &stop); if (!stop) { object->addword(object, hira); /* 平仮名による辞書引き */ add_mnode_query(object, hira); /* 片仮名文字列を生成し候補に加える */ kata = romaji_convert(object->hira2kata, hira, NULL); object->addword(object, kata); /* カタカナによる辞書引き */ add_mnode_query(object, kata); romaji_release(object->hira2kata, kata); /* カタカナ解放 */ } romaji_release(object->roma2hira, hira); /* 平仮名解放 */ return stop ? 1 : 0; } /* * ローマ字変換が不完全だった時に、[aiueo]および"xn"と"xtu"を補って変換して * みる。 */ static void add_dubious_roma(migemo* object, rxgen* rx, unsigned char* query) { static unsigned char candidate[] = VOWELS_STRING; int len; char *buf; if (!(len = strlen(query))) return; if (!(buf = malloc(len + 1 + 3))) /* NULと拡張文字用(最長:xtu) */ return; memcpy(buf, query, len + 1); buf[len + 1] = '\0'; if (!strchr(candidate, buf[len - 1])) { unsigned char *ptr; /* [aiueo]を順番に補う */ for (ptr = candidate; *ptr; ++ptr) { buf[len] = *ptr; add_roma(object, buf); } /* 未確定単語の長さが2未満か、未確定文字の直前が母音ならば… */ if (len < 2 || strchr(candidate, buf[len - 2])) { if (buf[len - 1] == 'n') { /* 「ん」を補ってみる */ strcpy(&buf[len - 1], "xn"); add_roma(object, buf); } else { /* 「っ」を補ってみる */ strcpy(&buf[len - 1], "xtu"); add_roma(object, buf); } } } free(buf); } /* * queryを文節に分解する。文節の切れ目は通常アルファベットの大文字。文節が複 * 数文字の大文字で始まった文節は非大文字を区切りとする。 */ static wordlist_p parse_query(unsigned char* query) { unsigned char *buf = query; wordlist_p querylist = NULL, *pp = &querylist; while (*buf != '\0') { unsigned char *start = buf++; if (isupper(start[0]) && isupper(buf[0])) { ++buf; while (buf[0] != '\0' && isupper(buf[0])) ++buf; } else while (buf[0] != '\0' && !isupper(buf[0])) ++buf; *pp = wordlist_open_len(start, buf - start); pp = &(*pp)->next; } return querylist; } /* * 1つの単語をmigemo変換。引数のチェックは行なわない。 */ static int query_a_word(migemo* object, unsigned char* query) { unsigned char* zen; /* query自信はもちろん候補に加える */ object->addword(object, query); /* queryそのものでの辞書引き */ add_mnode_query(object, query); /* queryを全角にして候補に加える */ zen = romaji_convert2(object->han2zen, query, NULL, 0); if (zen != NULL) { object->addword(object, zen); romaji_release(object->han2zen, zen); } /* 平仮名、カタカナ、及びそれによる辞書引き追加 */ if (add_roma(object, query)) add_dubious_roma(object, object->rx, query); return 1; } static int addword_rxgen(migemo* object, unsigned char* word) { return rxgen_add(object->rx, word); } /** * queryで与えられた文字列(ローマ字)を日本語検索のための正規表現へ変換する。 * 戻り値は変換された結果の文字列(正規表現)で、使用後は#migemo_release()関数 * へ渡すことで解放しなければならない。 * @param object Migemoオブジェクト * @param query 問い合わせ文字列 * @returns 正規表現文字列。#migemo_release() で解放する必要有り。 */ EXPORTS unsigned char* migemo_query(migemo* object, unsigned char* query) { unsigned char *retval = NULL; wordlist_p querylist = NULL; wordbuf_p outbuf = NULL; if (object && object->rx && query) { wordlist_p p; querylist = parse_query(query); if (querylist == NULL) goto MIGEMO_QUERY_END; /* 空queryのためエラー */ outbuf = wordbuf_open(); if (outbuf == NULL) goto MIGEMO_QUERY_END; /* 出力用のメモリ領域不足のためエラー */ /* 単語群をrxgenオブジェクトに入力し正規表現を得る */ object->addword = (MIGEMO_PROC_ADDWORD)addword_rxgen; rxgen_reset(object->rx); for (p = querylist; p; p = p->next) { unsigned char* answer; query_a_word(object, p->ptr); /* 検索パターン(正規表現)生成 */ answer = rxgen_generate(object->rx); rxgen_reset(object->rx); wordbuf_cat(outbuf, answer); rxgen_release(object->rx, answer); } } MIGEMO_QUERY_END: if (outbuf) { retval = outbuf->buf; outbuf->buf = NULL; wordbuf_close(outbuf); } if (querylist) wordlist_close(querylist); return retval; } /** * 使い終わったmigemo_query()関数で得られた正規表現を解放する。 * @param p Migemoオブジェクト * @param string 正規表現文字列 */ EXPORTS void migemo_release(migemo* p, unsigned char* string) { free(string); } /** * Migemoオブジェクトが生成する正規表現に使用するメタ文字(演算子)を指定す * る。indexでどのメタ文字かを指定し、opで置き換える。indexには以下の値が指 * 定可能である: * *
*
MIGEMO_OPINDEX_OR
*
論理和。デフォルトは "|" 。vimで利用する際は "\|" 。
*
MIGEMO_OPINDEX_NEST_IN
*
グルーピングに用いる開き括弧。デフォルトは "(" 。vimではレジスタ * \\1〜\\9に記憶させないようにするために "\%(" を用いる。Perlでも同様の * ことを目論むならば "(?:" が使用可能。
*
MIGEMO_OPINDEX_NEST_OUT
*
グルーピングの終了を表す閉じ括弧。デフォルトでは ")" 。vimでは * "\)" 。
*
MIGEMO_OPINDEX_SELECT_IN
*
選択の開始を表す開き角括弧。デフォルトでは "[" 。
*
MIGEMO_OPINDEX_SELECT_OUT
*
選択の終了を表す閉じ角括弧。デフォルトでは "]" 。
*
MIGEMO_OPINDEX_NEWLINE
*
各文字の間に挿入される「0個以上の空白もしくは改行にマッチする」 * パターン。デフォルトでは "" であり設定されない。vimでは "\_s*" を指 * 定する。
*
* * デフォルトのメタ文字は特に断りがない限りPerlのそれと同じ意味である。設定 * に成功すると戻り値は1(0以外)となり、失敗すると0になる。 * @param object Migemoオブジェクト * @param index メタ文字識別子 * @param op メタ文字文字列 * @returns 成功時0以外、失敗時0。 */ EXPORTS int migemo_set_operator(migemo* object, int index, unsigned char* op) { if (object) { int retval = rxgen_set_operator(object->rx, index, op); return retval ? 0 : 1; } else return 0; } /** * Migemoオブジェクトが生成する正規表現に使用しているメタ文字(演算子)を取得 * する。indexについてはmigemo_set_operator()関数を参照。戻り値にはindexの指 * 定が正しければメタ文字を格納した文字列へのポインタが、不正であればNULLが * 返る。 * @param object Migemoオブジェクト * @param index メタ文字識別子 * @returns 現在のメタ文字文字列 */ EXPORTS const unsigned char* migemo_get_operator(migemo* object, int index) { return object ? rxgen_get_operator(object->rx, index) : NULL; } /** * Migemoオブジェクトにコード変換用のプロシージャを設定する。プロシージャに * ついての詳細は「型リファレンス」セクションのMIGEMO_PROC_CHAR2INTを参照。 * @param object Migemoオブジェクト * @param proc コード変換用プロシージャ */ EXPORTS void migemo_setproc_char2int(migemo* object, MIGEMO_PROC_CHAR2INT proc) { if (object) rxgen_setproc_char2int(object->rx, (RXGEN_PROC_CHAR2INT)proc); } /** * Migemoオブジェクトにコード変換用のプロシージャを設定する。プロシージャに * ついての詳細は「型リファレンス」セクションのMIGEMO_PROC_INT2CHARを参照。 * @param object Migemoオブジェクト * @param proc コード変換用プロシージャ */ EXPORTS void migemo_setproc_int2char(migemo* object, MIGEMO_PROC_INT2CHAR proc) { if (object) rxgen_setproc_int2char(object->rx, (RXGEN_PROC_INT2CHAR)proc); } /** * Migemoオブジェクトにmigemo_dictが読み込めているかをチェックする。有効な * migemo_dictを読み込めて内部に変換テーブルが構築できていれば0以外(TRUE) * を、構築できていないときには0(FALSE)を返す。 * @param obj Migemoオブジェクト * @returns 成功時0以外、失敗時0。 */ EXPORTS int migemo_is_enable(migemo* obj) { return obj ? obj->enable : 0; } #if 1 /* * 主にデバッグ用の隠し関数 */ EXPORTS void migemo_print(migemo* object) { if (object) mnode_print(object->mtree, NULL); } #endif cmigemo-1.2+gh0.20140306/src/migemo.def000066400000000000000000000004651230636573300171050ustar00rootroot00000000000000; Written By: Muraoka Taro ; Last Change: 22-Jun-2002. LIBRARY MIGEMO ;DESCRIPTION "Migemo DLL" EXPORTS migemo_open migemo_close migemo_query migemo_release migemo_set_operator migemo_get_operator migemo_setproc_char2int migemo_setproc_int2char migemo_load migemo_is_enable cmigemo-1.2+gh0.20140306/src/migemo.h000066400000000000000000000031141230636573300165700ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * migemo.h - * * Written By: MURAOKA Taro * Last Change: 28-Oct-2003. */ #ifndef MIGEMO_H #define MIGEMO_H #define MIGEMO_VERSION "1.1" /* for migemo_load() */ #define MIGEMO_DICTID_INVALID 0 #define MIGEMO_DICTID_MIGEMO 1 #define MIGEMO_DICTID_ROMA2HIRA 2 #define MIGEMO_DICTID_HIRA2KATA 3 #define MIGEMO_DICTID_HAN2ZEN 4 /* for migemo_set_operator()/migemo_get_operator(). see: rxgen.h */ #define MIGEMO_OPINDEX_OR 0 #define MIGEMO_OPINDEX_NEST_IN 1 #define MIGEMO_OPINDEX_NEST_OUT 2 #define MIGEMO_OPINDEX_SELECT_IN 3 #define MIGEMO_OPINDEX_SELECT_OUT 4 #define MIGEMO_OPINDEX_NEWLINE 5 /* see: rxgen.h */ typedef int (*MIGEMO_PROC_CHAR2INT)(unsigned char*, unsigned int*); typedef int (*MIGEMO_PROC_INT2CHAR)(unsigned int, unsigned char*); /** * Migemoオブジェクト。migemo_open()で作成され、migemo_closeで破棄される。 */ typedef struct _migemo migemo; #ifdef __cplusplus extern "C" { #endif migemo* migemo_open(char* dict); void migemo_close(migemo* object); unsigned char* migemo_query(migemo* object, unsigned char* query); void migemo_release(migemo* object, unsigned char* string); int migemo_set_operator(migemo* object, int index, unsigned char* op); const unsigned char* migemo_get_operator(migemo* object, int index); void migemo_setproc_char2int(migemo* object, MIGEMO_PROC_CHAR2INT proc); void migemo_setproc_int2char(migemo* object, MIGEMO_PROC_INT2CHAR proc); int migemo_load(migemo* obj, int dict_id, char* dict_file); int migemo_is_enable(migemo* obj); #ifdef __cplusplus } #endif #endif /* MIGEMO_H */ cmigemo-1.2+gh0.20140306/src/migemo.rc000066400000000000000000000047411230636573300167540ustar00rootroot00000000000000//Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // 日本語 resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) #ifdef _WIN32 LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT #pragma code_page(932) #endif //_WIN32 #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 2002,6,22,17 PRODUCTVERSION 1,1,0,7 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "041104b0" BEGIN VALUE "Comments", "ローマ字による日本語検索正規表現生成ライブラリ\0" VALUE "CompanyName", "KaoriYa\0" VALUE "FileDescription", "migemo in C\0" VALUE "FileVersion", "2002, 6, 22, 17\0" VALUE "InternalName", "migemo\0" VALUE "LegalCopyright", "2002 (C) MURAOKA Taro (KoRoN)/KaoriYa\0" VALUE "LegalTrademarks", "C/Migemo library\0" VALUE "OriginalFilename", "migemo.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "Migemo DLL\0" VALUE "ProductVersion", "1, 1, 0, 7\0" VALUE "SpecialBuild", "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x411, 1200 END END #endif // !_MAC #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // 日本語 resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED cmigemo-1.2+gh0.20140306/src/mnode.c000066400000000000000000000152631230636573300164200ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * mnode.c - mnode interfaces. * * Written By: Muraoka Taro * Last Change: 15-May-2002. */ #include #include #include #include #include "dbg.h" #include "wordlist.h" #include "wordbuf.h" #include "mnode.h" #define MTREE_MNODE_N 1024 struct _mtree_t { mtree_p active; int used; mnode nodes[MTREE_MNODE_N]; mtree_p next; }; #define MNODE_BUFSIZE 16384 #if defined(_MSC_VER) || defined(__GNUC__) # define INLINE __inline #else # define INLINE #endif int n_mnode_new = 0; int n_mnode_delete = 0; INLINE static mnode* mnode_new(mtree_p mtree) { mtree_p active = mtree->active; if (active->used >= MTREE_MNODE_N) { active->next = (mtree_p)calloc(1, sizeof(*active->next)); /* TODO: エラー処理 */ mtree->active = active->next; active = active->next; } ++n_mnode_new; return &active->nodes[active->used++]; } static void mnode_delete(mnode* p) { while (p) { mnode* child = p->child; if (p->list) wordlist_close(p->list); if (p->next) mnode_delete(p->next); /*free(p);*/ p = child; ++n_mnode_delete; } } void mnode_print_stub(mnode* vp, unsigned char* p) { static unsigned char buf [256]; if (!vp) return; if (!p) p = &buf[0]; p[0] = MNODE_GET_CH(vp); p[1] = '\0'; if (vp->list) printf("%s (list=%p)\n", buf, vp->list); if (vp->child) mnode_print_stub(vp->child, p + 1); if (vp->next) mnode_print_stub(vp->next, p); } void mnode_print(mtree_p mtree, unsigned char* p) { if (mtree && mtree->used > 0) mnode_print_stub(&mtree->nodes[0], p); } void mnode_close(mtree_p mtree) { if (mtree) { mtree_p next; if (mtree->used > 0) mnode_delete(&mtree->nodes[0]); while (mtree) { next = mtree->next; free(mtree); mtree = next; } } } INLINE static mnode* search_or_new_mnode(mtree_p mtree, wordbuf_p buf) { /* ラベル単語が決定したら検索木に追加 */ int ch; unsigned char *word; mnode **ppnext; mnode **res = NULL; /* To suppress warning for GCC */ mnode *root; word = WORDBUF_GET(buf); root = mtree->used > 0 ? &mtree->nodes[0] : NULL; ppnext = &root; while ((ch = *word) != 0) { res = ppnext; if (! *res) { *res = mnode_new(mtree); MNODE_SET_CH(*res, ch); } else if (MNODE_GET_CH(*res) != ch) { ppnext = &(*res)->next; continue; } ppnext = &(*res)->child; ++word; } _ASSERT(*res != NULL); return *res; } /* * 既存のノードにファイルからデータをまとめて追加する。 */ mtree_p mnode_load(mtree_p mtree, FILE* fp) { mnode *pp = NULL; int mode = 0; int ch; wordbuf_p buf; wordbuf_p prevlabel; wordlist_p *ppword = NULL; /* To suppress warning for GCC */ /* 読み込みバッファ用変数 */ unsigned char cache[MNODE_BUFSIZE]; unsigned char *cache_ptr = cache; unsigned char *cache_tail = cache; buf = wordbuf_open(); prevlabel = wordbuf_open(); if (!fp || !buf || !prevlabel) { goto END_MNODE_LOAD; } /* * EOFの処理が曖昧。不正な形式のファイルが入った場合を考慮していない。各 * モードからEOFの道を用意しないと正しくないが…面倒なのでやらない。デー * タファイルは絶対に間違っていないという前提を置く。 */ do { if (cache_ptr >= cache_tail) { cache_ptr = cache; cache_tail = cache + fread(cache, 1, MNODE_BUFSIZE, fp); ch = (cache_tail <= cache && feof(fp)) ? EOF : *cache_ptr; } else ch = *cache_ptr; ++cache_ptr; /* 状態:modeのオートマトン */ switch (mode) { case 0: /* ラベル単語検索モード */ /* 空白はラベル単語になりえません */ if (isspace(ch) || ch == EOF) continue; /* コメントラインチェック */ else if (ch == ';') { mode = 2; /* 行末まで食い潰すモード へ移行 */ continue; } else { mode = 1; /* ラベル単語の読込モード へ移行*/ wordbuf_reset(buf); wordbuf_add(buf, (unsigned char)ch); } break; case 1: /* ラベル単語の読込モード */ /* ラベルの終了を検出 */ switch (ch) { default: wordbuf_add(buf, (unsigned char)ch); break; case '\t': pp = search_or_new_mnode(mtree, buf); wordbuf_reset(buf); mode = 3; /* 単語前空白読飛ばしモード へ移行 */ break; } break; case 2: /* 行末まで食い潰すモード */ if (ch == '\n') { wordbuf_reset(buf); mode = 0; /* ラベル単語検索モード へ戻る */ } break; case 3: /* 単語前空白読み飛ばしモード */ if (ch == '\n') { wordbuf_reset(buf); mode = 0; /* ラベル単語検索モード へ戻る */ } else if (ch != '\t') { /* 単語バッファリセット */ wordbuf_reset(buf); wordbuf_add(buf, (unsigned char)ch); /* 単語リストの最後を検索(同一ラベルが複数時) */ ppword = &pp->list; while (*ppword) ppword = &(*ppword)->next; mode = 4; /* 単語の読み込みモード へ移行 */ } break; case 4: /* 単語の読み込みモード */ switch (ch) { case '\t': case '\n': /* 単語を記憶 */ *ppword = wordlist_open_len(WORDBUF_GET(buf), WORDBUF_LEN(buf)); wordbuf_reset(buf); if (ch == '\t') { ppword = &(*ppword)->next; mode = 3; /* 単語前空白読み飛ばしモード へ戻る */ } else { ppword = NULL; mode = 0; /* ラベル単語検索モード へ戻る */ } break; default: wordbuf_add(buf, (unsigned char)ch); break; } break; } } while (ch != EOF); END_MNODE_LOAD: wordbuf_close(buf); wordbuf_close(prevlabel); return mtree; } mtree_p mnode_open(FILE* fp) { mtree_p mtree; mtree = (mtree_p)calloc(1, sizeof(*mtree)); mtree->active = mtree; if (mtree && fp) mnode_load(mtree, fp); return mtree; } #if 0 static int mnode_size(mnode* p) { return p ? mnode_size(p->child) + mnode_size(p->next) + 1 : 0; } #endif static mnode* mnode_query_stub(mnode* node, unsigned char* query) { while (1) { if (*query == MNODE_GET_CH(node)) return (*++query == '\0') ? node : (node->child ? mnode_query_stub(node->child, query) : NULL); if (!(node = node->next)) break; } return NULL; } mnode* mnode_query(mtree_p mtree, unsigned char* query) { return (query && *query != '\0' && mtree) ? mnode_query_stub(&mtree->nodes[0], query) : 0; } static void mnode_traverse_stub(mnode* node, MNODE_TRAVERSE_PROC proc, void* data) { while (1) { if (node->child) mnode_traverse_stub(node->child, proc, data); proc(node, data); if (!(node = node->next)) break; } } void mnode_traverse(mnode *node, MNODE_TRAVERSE_PROC proc, void* data) { if (node && proc) { proc(node, data); if (node->child) mnode_traverse_stub(node->child, proc, data); } } cmigemo-1.2+gh0.20140306/src/mnode.h000066400000000000000000000021441230636573300164170ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * mnode.h - * * Written By: Muraoka Taro * Last Change: 15-May-2002. */ /* * Need to include */ #ifndef MNODE_H #define MNODE_H /* ツリーオブジェクト */ typedef struct _mnode mnode; struct _mnode { unsigned int attr; mnode* next; mnode* child; wordlist_p list; }; #define MNODE_MASK_CH 0x000000FF #define MNODE_GET_CH(p) ((unsigned char)(p)->attr) #define MNODE_SET_CH(p,c) ((p)->attr = (c)) typedef struct _mtree_t mtree_t, *mtree_p; /* for mnode_traverse() */ typedef void (*mnode_traverse_proc)(mnode* node, void* data); #define MNODE_TRAVERSE_PROC mnode_traverse_proc extern int n_mnode_new; extern int n_mnode_delete; #ifdef __cplusplus extern "C" { #endif mtree_p mnode_open(FILE* fp); mtree_p mnode_load(mtree_p root, FILE* fp); void mnode_close(mtree_p p); mnode* mnode_query(mtree_p node, unsigned char* query); void mnode_traverse(mnode *node, MNODE_TRAVERSE_PROC proc, void* data); /* 主にデバッグ用途 */ void mnode_print(mtree_p mtree, unsigned char* p); #ifdef __cplusplus } #endif #endif /* MNODE_H */ cmigemo-1.2+gh0.20140306/src/resource.h000066400000000000000000000006131230636573300171430ustar00rootroot00000000000000//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by migemo.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif cmigemo-1.2+gh0.20140306/src/romaji.c000066400000000000000000000177721230636573300166060ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * romaji.c - ローマ字変換 * * Written By: Muraoka Taro * Last Change: 29-Dec-2003. */ #include #include #include #include #include "wordbuf.h" #include "romaji.h" #if defined(_MSC_VER) || defined(__GNUC__) # define INLINE __inline #else # define INLINE #endif #define ROMANODE_VALUE_MAXLEN 7 #define ROMAJI_KEY_MAXLEN 8 #define ROMAJI_FIXKEY_N 'n' #define ROMAJI_FIXKEY_XN "xn" #define ROMAJI_FIXKEY_XTU "xtu" #define ROMAJI_FIXKEY_NONXTU "aiueon" /* * romanode interfaces */ typedef struct _romanode romanode; struct _romanode { unsigned char key; unsigned char value[ROMANODE_VALUE_MAXLEN]; romanode* next; romanode* child; }; int n_romanode_new = 0; int n_romanode_delete = 0; INLINE static romanode* romanode_new() { ++n_romanode_new; return (romanode*)calloc(1, sizeof(romanode)); } static void romanode_delete(romanode* node) { while (node) { romanode* child = node->child; if (node->next) romanode_delete(node->next); free(node); node = child; ++n_romanode_delete; } } static romanode** romanode_dig(romanode** ref_node, unsigned char* key) { if (!ref_node || !key || key[0] == '\0') return NULL; while (1) { if (!*ref_node) { if (!(*ref_node = romanode_new())) return NULL; (*ref_node)->key = *key; } if ((*ref_node)->key == *key) { (*ref_node)->value[0] = '\0'; if (!*++key) break; ref_node = &(*ref_node)->child; } else ref_node = &(*ref_node)->next; } if ((*ref_node)->child) { romanode_delete((*ref_node)->child); (*ref_node)->child = 0; } return ref_node; } static romanode* romanode_query(romanode* node, unsigned char* key, int* skip) { int nskip = 0; if (node && key && *key) { while (1) { if (*key != node->key) node = node->next; else { ++nskip; if (node->value[0]) break; if (!*++key) { nskip = 0; break; } node = node->child; } if (!node) { nskip = 1; break; } } } if (skip) *skip = nskip; return node; } #if 0 /* 未使用のため */ static void romanode_print_stub(romanode* node, unsigned char* p) { static unsigned char buf[256]; if (!p) p = &buf[0]; p[0] = node->key; p[1] = '\0'; if (node->value[0]) printf("%s=%s\n", buf, node->value); if (node->child) romanode_print_stub(node->child, p + 1); if (node->next) romanode_print_stub(node->next, p); } static void romanode_print(romanode* node) { if (!node) return; romanode_print_stub(node, NULL); } #endif /* * romaji interfaces */ struct _romaji { romanode* node; unsigned char fixvalue_xn[ROMANODE_VALUE_MAXLEN]; unsigned char fixvalue_xtu[ROMANODE_VALUE_MAXLEN]; }; static unsigned char* strdup_lower(unsigned char* string) { unsigned char *out = strdup(string), *tmp; if (out) for (tmp = out; *tmp; ++tmp) *tmp = tolower(*tmp); return out; } romaji* romaji_open() { return (romaji*)calloc(1, sizeof(romaji)); } void romaji_close(romaji* object) { if (object) { if (object->node) romanode_delete(object->node); free(object); } } int romaji_add_table(romaji* object, unsigned char* key, unsigned char* value) { int len; romanode **ref_node; if (!object || !key || !value) return 1; /* Unexpected error */ len = strlen(value); if (len == 0 || len >= ROMANODE_VALUE_MAXLEN) return 2; /* Too short/long value string */ len = strlen(key); if (len == 0 || len >= ROMAJI_KEY_MAXLEN) return 3; /* Too short/long key string */ if (!(ref_node = romanode_dig(&object->node, key))) { return 4; /* Memory exhausted */ } /*printf("romaji_add_table(\"%s\", \"%s\")\n", key, value);*/ strcpy((*ref_node)->value, value); /* 「ん」と「っ」は保存しておく */ if (!strcmp(key, ROMAJI_FIXKEY_XN)) { /*fprintf(stderr, "XN: key=%s, value=%s\n", key, value);*/ strcpy(object->fixvalue_xn, value); } if (!strcmp(key, ROMAJI_FIXKEY_XTU)) { /*fprintf(stderr, "XTU: key=%s, value=%s\n", key, value);*/ strcpy(object->fixvalue_xtu, value); } return 0; } int romaji_load_stub(romaji* object, FILE* fp) { int mode, ch; wordbuf_p buf_key; wordbuf_p buf_value; buf_key = wordbuf_open(); buf_value = wordbuf_open(); if (!buf_key || !buf_value) { wordbuf_close(buf_key); wordbuf_close(buf_value); return -1; } mode = 0; do { ch = fgetc(fp); switch (mode) { case 0: /* key待ちモード */ if (ch == '#') mode = 1; /* 行末まで読み飛ばしモード へ移行 */ else if (ch != EOF && !isspace(ch)) { wordbuf_reset(buf_key); wordbuf_add(buf_key, (unsigned char)ch); mode = 2; /* key読み込みモード へ移行 */ } break; case 1: /* 行末まで読み飛ばしモード */ if (ch == '\n') mode = 0; /* key待ちモード へ移行 */ break; case 2: /* key読み込みモード */ if (!isspace(ch)) wordbuf_add(buf_key, (unsigned char)ch); else mode = 3; /* value待ちモード へ移行 */ break; case 3: /* value待ちモード */ if (ch != EOF && !isspace(ch)) { wordbuf_reset(buf_value); wordbuf_add(buf_value, (unsigned char)ch); mode = 4; /* value読み込みモード へ移行 */ } break; case 4: /* value読み込みモード */ if (ch != EOF && !isspace(ch)) wordbuf_add(buf_value, (unsigned char)ch); else { unsigned char *key = WORDBUF_GET(buf_key); unsigned char *value = WORDBUF_GET(buf_value); romaji_add_table(object, key, value); mode = 0; } break; } } while (ch != EOF); wordbuf_close(buf_key); wordbuf_close(buf_value); return 0; } int romaji_load(romaji* object, unsigned char* filename) { FILE *fp; if (object && filename && (fp = fopen(filename, "rt"))) { int result = result = romaji_load_stub(object, fp); fclose(fp); return result; } else return -1; } unsigned char* romaji_convert2(romaji* object, unsigned char* string, unsigned char** ppstop, int ignorecase) { /* Argument "ppstop" receive conversion stoped position. */ wordbuf_p buf = NULL; unsigned char *lower = NULL; unsigned char *answer = NULL; unsigned char *input = string; int stop = -1; if (ignorecase) { lower = strdup_lower(string); input = lower; } if (object && string && input && (buf = wordbuf_open())) { int i; for (i = 0; string[i]; ) { romanode *node; int skip; /* 「っ」の判定 */ if (object->fixvalue_xtu[0] && input[i] == input[i + 1] && !strchr(ROMAJI_FIXKEY_NONXTU, input[i])) { ++i; wordbuf_cat(buf, object->fixvalue_xtu); continue; } node = romanode_query(object->node, &input[i], &skip); if (!skip) { #if 0 /* * queryの最後がnの場合強制的に「ん」に変換したいところだ * が、その場合migemoの方で[なにぬねのん]を検索できない不具 * 合となる。今回は泣く。 */ /* 「n(子音)」を「ん(子音)」に変換 */ if (input[i] == ROMAJI_FIXKEY_N && object->fixvalue_xn[0]) { ++i; wordbuf_cat(buf, object->fixvalue_xn); } #endif if (string[i]) { stop = WORDBUF_LEN(buf); wordbuf_cat(buf, &string[i]); } break; } else if (!node) { /* 「n(子音)」を「ん(子音)」に変換 */ if (skip == 1 && input[i] == ROMAJI_FIXKEY_N && object->fixvalue_xn[0]) { ++i; wordbuf_cat(buf, object->fixvalue_xn); } else while (skip--) wordbuf_add(buf, string[i++]); } else { i += skip; wordbuf_cat(buf, node->value); } } answer = strdup(WORDBUF_GET(buf)); } if (ppstop) *ppstop = (stop >= 0) ? answer + stop : NULL; if (lower) free(lower); if (buf) wordbuf_close(buf); return answer; } unsigned char* romaji_convert(romaji* object, unsigned char* string, unsigned char** ppstop) { return romaji_convert2(object, string, ppstop, 1); } void romaji_release(romaji* object, unsigned char* string) { free(string); } cmigemo-1.2+gh0.20140306/src/romaji.h000066400000000000000000000014061230636573300165760ustar00rootroot00000000000000/* vi:set ts=8 sts=4 sw=4 tw=0: */ /* * romaji.h - ローマ字変換 * * Written By: Muraoka Taro * Last Change: 29-Dec-2003. */ #ifndef ROMAJI_H #define ROMAJI_H typedef struct _romaji romaji; #ifdef __cplusplus extern "C" { #endif romaji* romaji_open(); void romaji_close(romaji* object); int romaji_add_table(romaji* object, unsigned char* key, unsigned char* value); int romaji_load(romaji* object, unsigned char* filename); unsigned char* romaji_convert(romaji* object, unsigned char* string, unsigned char** ppstop); unsigned char* romaji_convert2(romaji* object, unsigned char* string, unsigned char** ppstop, int ignorecase); void romaji_release(romaji* object, unsigned char* string); #ifdef __cplusplus } #endif #endif /* ROMAJI_H */ cmigemo-1.2+gh0.20140306/src/rxgen.c000066400000000000000000000202161230636573300164330ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * rxgen.c - regular expression generator * * Written By: Muraoka Taro * Last Change: 15-May-2002. */ #include #include #include #include "wordbuf.h" #include "rxgen.h" #define RXGEN_ENC_SJISTINY //#define RXGEN_OP_VIM #define RXGEN_OP_MAXLEN 8 #define RXGEN_OP_OR "|" #define RXGEN_OP_NEST_IN "(" #define RXGEN_OP_NEST_OUT ")" #define RXGEN_OP_SELECT_IN "[" #define RXGEN_OP_SELECT_OUT "]" #define RXGEN_OP_NEWLINE "" int n_rnode_new = 0; int n_rnode_delete = 0; typedef struct _rnode rnode; struct _rxgen { rnode *node; RXGEN_PROC_CHAR2INT char2int; RXGEN_PROC_INT2CHAR int2char; unsigned char op_or[RXGEN_OP_MAXLEN]; unsigned char op_nest_in[RXGEN_OP_MAXLEN]; unsigned char op_nest_out[RXGEN_OP_MAXLEN]; unsigned char op_select_in[RXGEN_OP_MAXLEN]; unsigned char op_select_out[RXGEN_OP_MAXLEN]; unsigned char op_newline[RXGEN_OP_MAXLEN]; }; /* * rnode interfaces */ struct _rnode { unsigned int code; rnode* child; rnode* next; }; static rnode* rnode_new() { ++n_rnode_new; return (rnode*)calloc(1, sizeof(rnode)); } static void rnode_delete(rnode* node) { while (node) { rnode* child = node->child; if (node->next) rnode_delete(node->next); free(node); node = child; ++n_rnode_delete; } } /* * rxgen interfaces */ static int default_char2int(unsigned char* in, unsigned int* out) { #if defined(RXGEN_ENC_SJISTINY) if (*in >= 0x80) { *out = (unsigned int)in[0] << 8 | (unsigned int)in[1]; return 2; } else { *out = *in; return 1; } #else *out = *in; return 1; #endif } static int default_int2char(unsigned int in, unsigned char* out) { /* outは最低でも16バイトはある、という仮定を置く */ #if defined(RXGEN_ENC_SJISTINY) if (in >= 0x100) { if (out) { out[0] = (unsigned char)((in >> 8) & 0xFF); out[1] = (unsigned char)(in & 0xFF); } return 2; } else { int len = 0; switch (in) { case '\\': case '.': case '*': case '^': case '$': case '/': #ifdef RXGEN_OP_VIM case '[': case ']': case '~': #endif if (out) out[len] = '\\'; ++len; default: if (out) out[len] = (unsigned char)(in & 0xFF); ++len; break; } return len; } #else if (out) out[0] = (unsigned char)(in & 0xFF); return 1; #endif } void rxgen_setproc_char2int(rxgen* object, RXGEN_PROC_CHAR2INT proc) { if (object) object->char2int = proc ? proc : default_char2int; } void rxgen_setproc_int2char(rxgen* object, RXGEN_PROC_INT2CHAR proc) { if (object) object->int2char = proc ? proc : default_int2char; } static int rxgen_call_char2int(rxgen* object, unsigned char* pch, unsigned int* code) { int len = object->char2int(pch, code); return len ? len : default_char2int(pch, code); } static int rxgen_call_int2char(rxgen* object, unsigned int code, unsigned char* buf) { int len = object->int2char(code, buf); return len ? len : default_int2char(code, buf); } rxgen* rxgen_open() { rxgen* object = (rxgen*)calloc(1, sizeof(rxgen)); if (object) { rxgen_setproc_char2int(object, NULL); rxgen_setproc_int2char(object, NULL); strcpy(object->op_or, RXGEN_OP_OR); strcpy(object->op_nest_in, RXGEN_OP_NEST_IN); strcpy(object->op_nest_out, RXGEN_OP_NEST_OUT); strcpy(object->op_select_in, RXGEN_OP_SELECT_IN); strcpy(object->op_select_out, RXGEN_OP_SELECT_OUT); strcpy(object->op_newline, RXGEN_OP_NEWLINE); } return object; } void rxgen_close(rxgen* object) { if (object) { rnode_delete(object->node); free(object); } } int rxgen_add(rxgen* object, unsigned char* word) { rnode **ppnode; if (!object || !word) return 0; ppnode = &object->node; while (1) { unsigned int code; int len = rxgen_call_char2int(object, word, &code); /* 終了条件 */ if (!code) { /* 入力パターンよりも長い既存パターンは破棄する */ if (*ppnode) { rnode_delete(*ppnode); *ppnode = NULL; } break; } while (*ppnode && (*ppnode)->code != code) ppnode = &(*ppnode)->next; if (!*ppnode) { /* 未知の長いパターンを辿って記憶する。 */ *ppnode = rnode_new(); (*ppnode)->code = code; } else if (!(*ppnode)->child) break; /* 既存パターンより長い入力パターンは破棄する */ ppnode = &(*ppnode)->child; word += len; } return 1; } static void rxgen_generate_stub(rxgen* object, wordbuf_t* buf, rnode* node) { unsigned char ch[16]; int chlen, nochild, haschild = 0, brother = 1; rnode *tmp; /* 現在の階層の特性(兄弟の数、子供の数)をチェックする */ for (tmp = node; tmp; tmp = tmp->next) { if (tmp->next) ++brother; if (tmp->child) ++haschild; } nochild = brother - haschild; /* 必要ならば()によるグルーピング */ if (brother > 1 && haschild > 0) wordbuf_cat(buf, object->op_nest_in); #if 1 /* 子の無いノードを先に[]によりグルーピング */ if (nochild > 0) { if (nochild > 1) wordbuf_cat(buf, object->op_select_in); for (tmp = node; tmp; tmp = tmp->next) { if (tmp->child) continue; chlen = rxgen_call_int2char(object, tmp->code, ch); ch[chlen] = '\0'; /*printf("nochild: %s\n", ch);*/ wordbuf_cat(buf, ch); } if (nochild > 1) wordbuf_cat(buf, object->op_select_out); } #endif #if 1 /* 子のあるノードを出力 */ if (haschild > 0) { /* グループを出力済みならORで繋ぐ */ if (nochild > 0) wordbuf_cat(buf, object->op_or); for (tmp = node; !tmp->child; tmp = tmp->next) ; while (1) { chlen = object->int2char(tmp->code, ch); ch[chlen] = '\0'; wordbuf_cat(buf, ch); /*printf("haschild: %s(brother=%d, haschild=%d)\n", ch, brother, haschild);*/ /* 空白・改行飛ばしのパターンを挿入 */ if (object->op_newline[0]) wordbuf_cat(buf, object->op_newline); rxgen_generate_stub(object, buf, tmp->child); for (tmp = tmp->next; tmp && !tmp->child; tmp = tmp->next) ; if (!tmp) break; if (haschild > 1) wordbuf_cat(buf, object->op_or); } } #endif /* 必要ならば()によるグルーピング */ if (brother > 1 && haschild > 0) wordbuf_cat(buf, object->op_nest_out); } unsigned char* rxgen_generate(rxgen* object) { unsigned char* answer = NULL; wordbuf_t *buf; if (object && (buf = wordbuf_open())) { if (object->node) rxgen_generate_stub(object, buf, object->node); answer = strdup(WORDBUF_GET(buf)); wordbuf_close(buf); } return answer; } void rxgen_release(rxgen* object, unsigned char* string) { free(string); } /* * rxgen_add()してきたパターンを全てリセット。 */ void rxgen_reset(rxgen* object) { if (object) { rnode_delete(object->node); object->node = NULL; } } static unsigned char* rxgen_get_operator_stub(rxgen* object, int index) { switch (index) { case RXGEN_OPINDEX_OR: return object->op_or; case RXGEN_OPINDEX_NEST_IN: return object->op_nest_in; case RXGEN_OPINDEX_NEST_OUT: return object->op_nest_out; case RXGEN_OPINDEX_SELECT_IN: return object->op_select_in; case RXGEN_OPINDEX_SELECT_OUT: return object->op_select_out; case RXGEN_OPINDEX_NEWLINE: return object->op_newline; default: return NULL; } } const unsigned char* rxgen_get_operator(rxgen* object, int index) { return (const unsigned char*) (object ? rxgen_get_operator_stub(object, index) : NULL); } int rxgen_set_operator(rxgen* object, int index, unsigned char* op) { unsigned char* dest; if (!object) return 1; /* Invalid object */ if (strlen(op) >= RXGEN_OP_MAXLEN) return 2; /* Too long operator */ if (!(dest = rxgen_get_operator_stub(object, index))) return 3; /* No such an operator */ strcpy(dest, op); return 0; } #if 0 /* * main */ int main(int argc, char** argv) { rxgen *prx; if (prx = rxgen_open()) { char buf[256], *ans; while (gets(buf) && !feof(stdin)) rxgen_add(prx, buf); ans = rxgen_generate(prx); printf("rxgen=%s\n", ans); rxgen_release(prx, ans); rxgen_close(prx); } fprintf(stderr, "n_rnode_new=%d\n", n_rnode_new); fprintf(stderr, "n_rnode_delete=%d\n", n_rnode_delete); } #endif cmigemo-1.2+gh0.20140306/src/rxgen.h000066400000000000000000000025071230636573300164430ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * rxgen.h - regular expression generator * * Written By: Muraoka Taro * Last Change: 17-Oct-2003. */ #ifndef RXGEN_H #define RXGEN_H typedef struct _rxgen rxgen; typedef int (*rxgen_proc_char2int)(unsigned char*, unsigned int*); typedef int (*rxgen_proc_int2char)(unsigned int, unsigned char*); #define RXGEN_PROC_CHAR2INT rxgen_proc_char2int #define RXGEN_PROC_INT2CHAR rxgen_proc_int2char /* for rxgen_set_operator */ #define RXGEN_OPINDEX_OR 0 #define RXGEN_OPINDEX_NEST_IN 1 #define RXGEN_OPINDEX_NEST_OUT 2 #define RXGEN_OPINDEX_SELECT_IN 3 #define RXGEN_OPINDEX_SELECT_OUT 4 #define RXGEN_OPINDEX_NEWLINE 5 extern int n_rnode_new; extern int n_rnode_delete; #ifdef __cplusplus extern "C" { #endif rxgen* rxgen_open(); void rxgen_close(rxgen* object); int rxgen_add(rxgen* object, unsigned char* word); unsigned char* rxgen_generate(rxgen* object); void rxgen_release(rxgen* object, unsigned char* string); void rxgen_reset(rxgen* object); void rxgen_setproc_char2int(rxgen* object, RXGEN_PROC_CHAR2INT proc); void rxgen_setproc_int2char(rxgen* object, RXGEN_PROC_INT2CHAR proc); int rxgen_set_operator(rxgen* object, int index, unsigned char* op); const unsigned char* rxgen_get_operator(rxgen* object, int index); #ifdef __cplusplus } #endif #endif /* RXGEN_H */ cmigemo-1.2+gh0.20140306/src/testdir/000077500000000000000000000000001230636573300166215ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/src/testdir/romaji_main.c000066400000000000000000000031721230636573300212550ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * romaji_main.c - * * Written By: Muraoka Taro * Last Change: 18-Oct-2003. */ /* * gcc -o romaji romaji_main.c ../romaji.c ../wordbuf.c */ #include #include #include "../romaji.h" #ifndef DICT_ROMA2HIRA # define DICT_ROMA2HIRA "../dict/roma2hira.dat" #endif #ifndef DICT_HIRA2KATA # define DICT_HIRA2KATA "../dict/hira2kata.dat" #endif void query_loop(romaji* object, romaji* hira2kata) { char buf[256], *ans; while (1) { printf("QUERY: "); if (!fgets(buf, sizeof(buf), stdin)) { printf("\n"); break; } /* 改行をNUL文字に置き換える */ if ((ans = strchr(buf, '\n')) != NULL) *ans = '\0'; { unsigned char *stop; unsigned char *hira; if (hira = romaji_convert(object, buf, &stop)) { unsigned char* kata; printf(" hira=%s, stop=%s\n", hira, stop); if (kata = romaji_convert(hira2kata, hira, &stop)) { printf(" kata=%s, stop=%s\n", kata, stop); romaji_release(hira2kata, kata); } fflush(stdout); romaji_release(object, hira); } } } } int main(int argc, char** argv) { romaji *object, *hira2kata; object = romaji_open(); hira2kata = romaji_open(); if (object && hira2kata) { int retval = 0; retval = romaji_load(object, DICT_ROMA2HIRA); printf("romaji_load(%s)=%d\n", DICT_ROMA2HIRA, retval); retval = romaji_load(hira2kata, DICT_HIRA2KATA); printf("romaji_load(%s)=%d\n", DICT_HIRA2KATA, retval); query_loop(object, hira2kata); } if (hira2kata) romaji_close(hira2kata); if (object) romaji_close(object); return 0; } cmigemo-1.2+gh0.20140306/src/wordbuf.c000066400000000000000000000042661230636573300167670ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * wordbuf.h - * * Written By: Muraoka Taro * Last Change: 13-Oct-2003. */ #include #include #include #include "wordbuf.h" #define WORDLEN_DEF 64 int n_wordbuf_open = 0; /* for DEBUG */ int n_wordbuf_close = 0; /* for DEBUG */ /* function pre-declaration */ static int wordbuf_extend(wordbuf_p p, int len); wordbuf_p wordbuf_open() { wordbuf_p p = (wordbuf_p)malloc(sizeof(wordbuf_t)); if (p) { ++n_wordbuf_open; /* for DEBUG */ p->len = WORDLEN_DEF; p->buf = (unsigned char*)malloc(p->len); p->last = 0; p->buf[0] = '\0'; } return p; } void wordbuf_close(wordbuf_p p) { if (p) { ++n_wordbuf_close; /* for DEBUG */ free(p->buf); free(p); } } void wordbuf_reset(wordbuf_p p) { p->last = 0; p->buf[0] = '\0'; } /* * wordbuf_extend(wordbuf_p p, int req_len); * バッファの伸長。エラー時には0が帰る。 * 高速化のために伸ばすべきかは呼出側で判断する。 */ static int wordbuf_extend(wordbuf_p p, int req_len) { int newlen = p->len * 2; unsigned char *newbuf; while (req_len > newlen) newlen *= 2; if (!(newbuf = (unsigned char*)realloc(p->buf, newlen))) { /*fprintf(stderr, "wordbuf_add(): failed to extend buffer\n");*/ return 0; } else { p->len = newlen; p->buf = newbuf; return req_len; } } int wordbuf_last(wordbuf_p p) { return p->last; } int wordbuf_add(wordbuf_p p, unsigned char ch) { int newlen = p->last + 2; if (newlen > p->len && !wordbuf_extend(p, newlen)) return 0; else { #if 1 unsigned char *buf = p->buf + p->last; buf[0] = ch; buf[1] = '\0'; #else /* リトルエンディアンを仮定するなら使えるが… */ *(unsigned short*)&p->buf[p->last] = (unsigned short)ch; #endif return ++p->last; } } int wordbuf_cat(wordbuf_p p, unsigned char* sz) { int len; if (sz && (len = strlen(sz)) > 0) { int newlen = p->last + len + 1; if (newlen > p->len && !wordbuf_extend(p, newlen)) return 0; memcpy(&p->buf[p->last], sz, len + 1); p->last = p->last + len; } return p->last; } unsigned char* wordbuf_get(wordbuf_p p) { return p->buf; } cmigemo-1.2+gh0.20140306/src/wordbuf.h000066400000000000000000000016051230636573300167660ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * wordbuf.h - * * Written By: Muraoka Taro * Last Change: 13-Oct-2003. */ #ifndef WORDBUF_H #define WORDBUF_H typedef struct _wordbuf_t wordbuf_t, *wordbuf_p; struct _wordbuf_t { int len; /* bufに割り当てられているメモリ量 */ unsigned char* buf; int last; /* bufに実際に格納している文字列の長さ */ }; extern int n_wordbuf_open; extern int n_wordbuf_close; #define wordbuf_len(w) wordbuf_last(w) #define WORDBUF_GET(w) ((w)->buf) #define WORDBUF_LEN(w) ((w)->last) #ifdef __cplusplus extern "C" { #endif wordbuf_p wordbuf_open(); void wordbuf_close(wordbuf_p p); void wordbuf_reset(wordbuf_p p); int wordbuf_last(wordbuf_p p); int wordbuf_add(wordbuf_p p, unsigned char ch); int wordbuf_cat(wordbuf_p p, unsigned char* sz); unsigned char* wordbuf_get(wordbuf_p p); #ifdef __cplusplus } #endif #endif /* WORDBUF_H */ cmigemo-1.2+gh0.20140306/src/wordlist.c000066400000000000000000000020071230636573300171550ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * wordlist.h - * * Written By: Muraoka Taro * Last Change: 15-May-2002. */ #include #include #include "wordlist.h" int n_wordlist_open = 0; int n_wordlist_close = 0; int n_wordlist_total = 0; wordlist_p wordlist_open_len(unsigned char* ptr, int len) { if (ptr && len >= 0) { wordlist_p p; if ((p = (wordlist_p)malloc(sizeof(*p) + len + 1)) != NULL) { p->ptr = (char*)(p + 1); p->next = NULL; /* * ほぼstrdup()と等価な実装。単語の保存に必要な総メモリを知りた * いので独自に再実装。 */ memcpy(p->ptr, ptr, len); p->ptr[len] = '\0'; ++n_wordlist_open; n_wordlist_total += len; } return p; } return NULL; } wordlist_p wordlist_open(unsigned char* ptr) { return ptr ? wordlist_open_len(ptr, strlen(ptr)) : NULL; } void wordlist_close(wordlist_p p) { while (p) { wordlist_p next = p->next; ++n_wordlist_close; free(p); p = next; } } cmigemo-1.2+gh0.20140306/src/wordlist.h000066400000000000000000000011611230636573300171620ustar00rootroot00000000000000/* vim:set ts=8 sts=4 sw=4 tw=0: */ /* * wordlist.h - * * Written By: Muraoka Taro * Last Change: 15-May-2002. */ #ifndef WORDLIST_H #define WORDLIST_H typedef struct _wordlist_t wordlist_t, *wordlist_p; struct _wordlist_t { unsigned char* ptr; wordlist_p next; }; extern int n_wordlist_open; extern int n_wordlist_close; extern int n_wordlist_total; #ifdef __cplusplus extern "C" { #endif wordlist_p wordlist_open(unsigned char* ptr); wordlist_p wordlist_open_len(unsigned char* ptr, int len); void wordlist_close(wordlist_p p); #ifdef __cplusplus } #endif #endif /* WORDLIST_H */ cmigemo-1.2+gh0.20140306/tools/000077500000000000000000000000001230636573300155145ustar00rootroot00000000000000cmigemo-1.2+gh0.20140306/tools/Migemo.cs000066400000000000000000000111621230636573300172610ustar00rootroot00000000000000// vim:set ts=4 sts=4 sw=4 tw=0: using System; using System.Runtime.InteropServices; using System.Text.RegularExpressions; namespace KaoriYa.Migemo { public class Migemo : IDisposable { #region Enumerations (from migemo.h) #region enum OperatorIndex public enum DictionaryId { Invalid = 0, Migemo = 1, RomaToHira = 2, HiraToKata = 3, HanToZen = 4, } #endregion #region enum OperatorIndex public enum OperatorIndex { Or = 0, NestIn = 1, NestOut = 2, SelectIn = 3, SelectOut = 4, NewLine = 5, } #endregion #endregion #region Link to migemo.dll [DllImport("migemo.dll")] private static extern IntPtr migemo_open(string dict); [DllImport("migemo.dll")] private static extern void migemo_close(IntPtr obj); [DllImport("migemo.dll")] private static extern IntPtr migemo_query(IntPtr obj, string query); [DllImport("migemo.dll")] private static extern void migemo_release(IntPtr obj, IntPtr result); [DllImport("migemo.dll")] private static extern int migemo_set_operator(IntPtr obj, OperatorIndex index, string op); [DllImport("migemo.dll")] private static extern IntPtr migemo_get_operator(IntPtr obj, OperatorIndex index); [DllImport("migemo.dll")] private static extern DictionaryId migemo_load(IntPtr obj, DictionaryId id, string file); [DllImport("migemo.dll")] private static extern int migemo_is_enable(IntPtr obj); #endregion private IntPtr migemoObject = IntPtr.Zero; public IntPtr MigemoObject { get { return this.migemoObject; } } public bool SetOperator(OperatorIndex index, string op) { return migemo_set_operator(this.migemoObject, index, op) != 0; } public string GetOperator(OperatorIndex index) { IntPtr result = migemo_get_operator(this.migemoObject, index); if (result != IntPtr.Zero) return Marshal.PtrToStringAnsi(result); else return ""; } #region Operator properties public string OperatorOr { get { return GetOperator(OperatorIndex.Or); } set { SetOperator(OperatorIndex.Or, value); } } public string OperatorNestIn { get { return GetOperator(OperatorIndex.NestIn); } set { SetOperator(OperatorIndex.NestIn, value); } } public string OperatorNestOut { get { return GetOperator(OperatorIndex.NestOut); } set { SetOperator(OperatorIndex.NestOut, value); } } public string OperatorSelectIn { get { return GetOperator(OperatorIndex.SelectIn); } set { SetOperator(OperatorIndex.SelectIn, value); } } public string OperatorSelectOut { get { return GetOperator(OperatorIndex.SelectOut); } set { SetOperator(OperatorIndex.SelectOut, value); } } public string OperatorNewLine { get { return GetOperator(OperatorIndex.NewLine); } set { SetOperator(OperatorIndex.NewLine, value); } } #endregion public bool LoadDictionary(DictionaryId id, string file) { DictionaryId result = migemo_load(this.migemoObject, id, file); return result == id; } public bool IsEnable() { return migemo_is_enable(this.migemoObject) != 0; } public Regex GetRegex(string query) { return new Regex(Query(query)); } public string Query(string query) { IntPtr result = migemo_query(this.migemoObject, query); if (result != IntPtr.Zero) { string retval = Marshal.PtrToStringAnsi(result); migemo_release(this.migemoObject, result); return retval; } else return ""; } public void Dispose() { //Console.WriteLine("HERE ("+this.migemoObject+")"); if (this.migemoObject != IntPtr.Zero) { //Console.WriteLine("migemo_close() is called"); migemo_close(this.migemoObject); this.migemoObject = IntPtr.Zero; } } public Migemo(string dictpath) { this.migemoObject = migemo_open(dictpath); this.OperatorNestIn = "(?:"; //this.OperatorNewLine = "\\s*"; } public Migemo() : this(null) { } #region Test entrypoint #if TEST_MIGEMO // テスト関数 public static int Main(string[] args) { Migemo m; if (args.Length > 0) { m = new Migemo(args[0]); Console.WriteLine("Migemo object is initialized with " +args[0]); } else { m = new Migemo(); Console.WriteLine("Migemo object is initialized"); } Console.WriteLine("MigemoObject="+m.MigemoObject); string result = m.Query("ao"); Console.WriteLine("ai="+result); OperatorIndex[] opall = { OperatorIndex.Or, OperatorIndex.NestIn, OperatorIndex.NestOut, OperatorIndex.SelectIn, OperatorIndex.SelectOut, OperatorIndex.NewLine }; foreach (OperatorIndex index in opall) Console.WriteLine("OperatorIndex[{0}]={1}", index, m.GetOperator(index)); return 0; } #endif #endregion } } cmigemo-1.2+gh0.20140306/tools/Test.cs000066400000000000000000000004111230636573300167560ustar00rootroot00000000000000// vim:set ts=4 sts=4 sw=4 tw=0: using System; using KaoriYa.Migemo; public class Test { public static int Main(string[] args) { Migemo m = new Migemo("../dict/migemo-dict"); string res = m.Query("kaki"); Console.WriteLine("kaki->"+res); return 0; } } cmigemo-1.2+gh0.20140306/tools/migemo.vim000066400000000000000000000034211230636573300175060ustar00rootroot00000000000000" vim:set ts=8 sts=2 sw=2 tw=0: " " migemo.vim " Direct search for Japanese with Romaji --- Migemo support script. " " Maintainer: MURAOKA Taro " Modified: Yasuhiro Matsumoto " Last Change: 07-Jun-2003. " Japanese Description: if exists('plugin_migemo_disable') finish endif function! s:SearchDict() let path = $VIM . ',' . &runtimepath let dict = globpath(path, "dict/migemo-dict") if dict == '' let dict = globpath(path, "migemo-dict") endif if dict == '' let dict = '/usr/local/share/migemo/'.&encoding.'/migemo-dict' if !filereadable(dict) let dict = '' endif endif return matchstr(dict, "^[^\]*") endfunction if has('migemo') if &migemodict == '' || !filereadable(&migemodict) let &migemodict = s:SearchDict() endif " テスト function! s:SearchChar(dir) let input = nr2char(getchar()) let pat = migemo(input) call search('\%(\%#.\{-\}\)\@<='.pat) noh endfunction nnoremap f :call SearchChar(0) else " non-builtin version let g:migemodict = s:SearchDict() command! -nargs=* Migemo :call MigemoSearch() nnoremap mi :call MigemoSearch('') function! s:MigemoSearch(word) if executable('cmigemo') == '' echohl ErrorMsg echo 'Error: cmigemo is not installed' echohl None return endif let retval = a:word != '' ? a:word : input('MIGEMO:') if retval == '' return endif let retval = system('cmigemo -v -w "'.retval.'" -d "'.g:migemodict.'"') if retval == '' return endif let @/ = retval let v:errmsg = '' silent! normal n if v:errmsg != '' echohl ErrorMsg echo v:errmsg echohl None endif endfunction endif cmigemo-1.2+gh0.20140306/tools/optimize-dict.pl000066400000000000000000000012711230636573300206330ustar00rootroot00000000000000#!/usr/bin/perl -w # vim:set ts=8 sts=4 sw=4 tw=0: # # optimize-dict.pl # # Last Change: 22-Jun-2002. # Written By: MURAOKA Taro binmode STDOUT; my %migemo; my @migemo; while (<>) { chomp; next if /^;/; my ($label, @word) = split /\t/; push @migemo, $label; push @{$migemo{$label}}, @word; } @migemo = sort {length($b) <=> length($a) or $a cmp $b} @migemo; my $i; for ($i = 0; $i < @migemo; ++$i) { my $label = $migemo[$i]; if (exists $migemo{$label}) { print "$label\t" . join("\t", &uniq_array($migemo{$label})) . "\n"; delete $migemo{$label}; } } sub uniq_array { my %array = map {$_, 1} @{$_[0]}; return keys %array } cmigemo-1.2+gh0.20140306/tools/skk2migemo.pl000066400000000000000000000017141230636573300201240ustar00rootroot00000000000000#!/usr/bin/perl # vim:set ts=8 sts=4 sw=4 tw=0: # # conv.pl - Convert SKK-JISYO to migemo-dict # # Last Change: 16-May-2002. # Written by: MURAOKA Taro binmode STDOUT; while (<>) { chomp; if (m/^;/) { print "$_\n"; next; } m/^([^ ]+) +(.*)$/; my ($key, $value) = ($1, $2); # Skip special key next if $key =~ m/^[<>?]/ or $key =~ m/[<>?]$/; # key have number expansion my $have_number = ($key =~ m/#/) ? 1 : 0; # Remove "okuri" if ($key =~ m/[a-z]$/ and $key !~ m/^[ -~]+$/) { $key =~ s/.$//; } $value =~ s{^/}{}; $value =~ s{/$}{}; @values = grep { # Remove lisp expressions. $_ !~ m/^\([a-zA-Z].*\)$/; } grep { # Remove values have number expression !$have_number || $_ !~ m/#/; } map { # Remove annotation s/;.*$//; $_; } split(/\//, $value); # Output if ($key ne '' and $#values >= 0) { print "$key\t" . join("\t", @values) . "\n"; } }