Git Product home page Git Product logo

pinyin-searcher's Issues

我来膜拜一下

做模糊查询时看了很多项目,大部分项目在中文转拼音预处理这个环节,算法是用一堆List堆出来的,我不得不在查询对象里保存这堆预处理的List,几千条数据每条都多了一大串List我想想都觉得恶心,后续关键字匹配过程也异常复杂而且臃肿,老实这些东西让我觉得很厌烦.但你这边竟然把它转变成正则表达式,这个算法真的太神奇了,简直是变魔术. 现在我只需要在查询对象里保存一段短短的字符串,而关键字匹配需要一次String.match就OK了.简直太神奇,非常感谢你!
另外,我看到你的PinyinSearcher.java里用到了很多反射,我想目的是为了兼容所有的实体类,所以通过反射来获取字段.我认为通过接口来做会更好.需要查询的对象implements查询接口,通过查询接口提供的
public String setSearchWord()来设置查询的字段.而外面提供的查询方法可以通过泛型<T extends 查询接口>,这样保持了灵活性,而且性能更高,更易懂.

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.