Published on

英文词汇、短语自动补全的实现

Authors
  • avatar
    Name
    Zifan Xiao
    Twitter

Demo

This is a demo of autocompletion (search bar/ text box). https://xzifan.github.io/Auto_Complete-demo

screenshot

The suggestion of words and expressions will show up in color grey. With a click of TAB, the textfield will complete with the suggestion.
The vocalbulary is based on what have been submitted. Expressions and words that are submitted can be used for later autocompletion.

For easier testing, the demo will load 10000 vocabulary and 1 expression "what's the weather like" by default.

Get started

Go to https://xzifan.github.io/Auto_Complete-demo
You can submit some words or expressions. In later input, you'll get suggestions for auto-completion of words if the word is not finished (haven't ended with a space). And possible suggestions for expressions when it end with a space.

If you wish to clear the default vocabulary and expression, you can try to click the title Auto-complete above the search bar.

Run in local environment

git clone https://github.com/xzifan/Auto_Complete-demo.git  && cd Auto_Complete-demo
npm install
npm start

Auto-Complete Words

Auto-Complete Words

Auto-Complete Expressions

Auto-Complete Expressions