Skip to content

Matching

zcons edited this page Nov 5, 2016 · 5 revisions

##Overview

  • Matching code goes through a few stages of query requests in the database. First the server connects to the database so it can access the ngram index table which will host all of the ngrams found within the master_table. Secondly it uses the ngrams found in the tokens passed in from the client to find the corresponding code that matches in the master_table. We use an aggregate query to grab the the top five matching codes grouped by the number of ngrams that matched with it. We perform an additionally matching algorithm: Levanshtein distance algorithm. We then return a client file object with the corresponding "fixed tokens"

##Classes

  • DatabaseServer.java is our class that holds all of the methods for accessing the Database TEST_DATABASE and sending sqlite queries to compare the client-sent tokens to the tokens stored in the master_table.

####Location

  • Current matching code is located within the database server class, DatabaseServer.java under gs-rest-server under /src/main/java/carleton/comps/
Clone this wiki locally