Giter VIP home page Giter VIP logo

apollo008 / orchid-fst Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 3.0 7.48 MB

This project Orchid-Fst implements a fast text string dictionary search data structure: Finite state transducer (short for FST) in c++ language.This FST C++ open source project has much significant advantages.

License: Apache License 2.0

CMake 1.68% Python 1.11% C++ 97.21%
fst cpp cpp11 dictionary mmap search-engine elasticsearch lucene levenshtein automaton

orchid-fst's People

Contributors

apollo008 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

orchid-fst's Issues

Compilation error

OS:Ubuntu18.04 64bit
在执行 cmake -DENABLE_BUILD_SHARE=ON ../src 命令的时候报错:

Making all in DllPlugInTester
make[2]: 进入目录“/home/xx/orchid-fst.git/build-dir/share/cppunit/cppunit-1.12.1/src/DllPlugInTester”
g++ -DHAVE_CONFIG_H -I. -I../../config -I../../include -I../../include -D_GLIBCXX_USE_CXX11_ABI=1 -MT DllPlugInTester.o -MD -MP -MF .deps/DllPlugInTester.Tpo -c -o DllPlugInTester.o DllPlugInTester.cpp
mv -f .deps/DllPlugInTester.Tpo .deps/DllPlugInTester.Po
g++ -DHAVE_CONFIG_H -I. -I../../config -I../../include -I../../include -D_GLIBCXX_USE_CXX11_ABI=1 -MT CommandLineParser.o -MD -MP -MF .deps/CommandLineParser.Tpo -c -o CommandLineParser.o CommandLineParser.cpp
mv -f .deps/CommandLineParser.Tpo .deps/CommandLineParser.Po
/bin/sh ../../libtool --tag=CXX --mode=link g++ -D_GLIBCXX_USE_CXX11_ABI=1 -ldl -o DllPlugInTester DllPlugInTester.o CommandLineParser.o ../../src/cppunit/libcppunit.la -lm
mkdir .libs
g++ -D_GLIBCXX_USE_CXX11_ABI=1 -o .libs/DllPlugInTester DllPlugInTester.o CommandLineParser.o -ldl ../../src/cppunit/.libs/libcppunit.so -lm -Wl,--rpath -Wl,/home/charles/local/lib
../../src/cppunit/.libs/libcppunit.so: undefined reference to dlopen' ../../src/cppunit/.libs/libcppunit.so: undefined reference to dlclose'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
Makefile:321: recipe for target 'DllPlugInTester' failed

还有后面的:

Making install in DllPlugInTester
make[2]: 进入目录“/home/xx/orchid-fst.git/build-dir/share/cppunit/cppunit-1.12.1/src/DllPlugInTester”
/bin/sh ../../libtool --tag=CXX --mode=link g++ -D_GLIBCXX_USE_CXX11_ABI=1 -ldl -o DllPlugInTester DllPlugInTester.o CommandLineParser.o ../../src/cppunit/libcppunit.la -lm
g++ -D_GLIBCXX_USE_CXX11_ABI=1 -o .libs/DllPlugInTester DllPlugInTester.o CommandLineParser.o -ldl ../../src/cppunit/.libs/libcppunit.so -lm -Wl,--rpath -Wl,/home/charles/local/lib
../../src/cppunit/.libs/libcppunit.so: undefined reference to dlopen' ../../src/cppunit/.libs/libcppunit.so: undefined reference to dlclose'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
Makefile:321: recipe for target 'DllPlugInTester' failed
make[2]: 离开目录“/home/xx/orchid-fst.git/build-dir/share/cppunit/cppunit-1.12.1/src/DllPlugInTester”
make[2]: *** [DllPlugInTester] Error 1
Makefile:243: recipe for target 'install-recursive' failed
make[1]: 离开目录“/home/xx/orchid-fst.git/build-dir/share/cppunit/cppunit-1.12.1/src”
make[1]: *** [install-recursive] Error 1
Makefile:443: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

Bug:Match & Fuzzy query has bugs.

The test constructs the English word dictionary as an fst file, and then performs match and fuzzy queries on it. Take the word "hair" as an example. It is included in the dictionary, but it cannot be found in the match. At the same time, when the fuzzy query is set to ed=0, the word cannot be found.
Match query:
ofst match -f /home/charles/test/orchid_mytest/fst_file/fst2 -q hair
2021-05-18 16:44:59 INFO COMMON_NS.MAIN : Found result:[hair]->[0], time consumed:[310] us.
Fuzzy query:
ofst fuzzy -f /home/charles/test/orchid_mytest/fst_file/fst2 -z hair -d 0
2021-05-18 16:46:58 INFO COMMON_NS.MAIN : Totally got [0] results, time consumed:[595] us.

But there is no error in the prefix query, let's take hair as an example:

ofst prefix -f /home/charles/test/orchid_mytest/fst_file/fst2 -p hair
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hair]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairball]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairballs]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairband]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairbands]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairbrush]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [haircare]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [haircloth]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [haircut]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [haircuts]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairdo]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairdos]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairdrier]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairdryer]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [haired]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairgrip]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairgrips]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairier]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairiest]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairily]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairiness]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairless]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairline]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairlines]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairnet]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairnets]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairpiece]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairpin]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairpins]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairs]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairslide]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairspray]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairstyle]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : [hairy]->[0]
2021-05-18 16:51:58 INFO COMMON_NS.MAIN : Totally got [34] results, time consumed:[1256] us.

Could you please show me where the problem is, thank you! @apollo008

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.