Skip to content
/ textsearch Public template

textSearch, a small program to present an autocomplete functionality in a simple UI.

Notifications You must be signed in to change notification settings

KevvKo/textsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Textsearch with autocomplete function

Textsearch is a small program with an UI, build with tkinter. It provides a autocomplete function, based on the prefix that you entered.

default user interface:

alt text

Getting started

To run the program, enter following command:

python3 textSearch.py *dataset* *k-rows*

The program gets two inputs:

  1. First, the name for the dataset, which constisting of two rows (weights, name). In this repository, you can find two datasets wiktionary.txt and cities.txt.
  2. Next input is the max output of results, that this program should be displaying (k-rows)

The ui will be shown and you can start to enter any string into the command line.

textsearch with a wiktionary.txt-dataset and max 5 rows as output

alt text

textsearch with a cities.txt-dataset and max 10 rows as output

alt text

Logic

textsearch takes the given prefix from the ui and searching with an adjusted binarysearch-function in the dataset. Based on the weights, autocomplete.py returns a descending ordered list with k-results for the prefix and displaying this in the ui. The sorting is based on weights, which present a probability.

About

textSearch, a small program to present an autocomplete functionality in a simple UI.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages