Commit 21f9ac04 authored by Seyed Reza  Sajjadinasab's avatar Seyed Reza Sajjadinasab
Browse files

Merge branch 'Reza' into 'master'

Reza

See merge request ec504/ec504_projects/group6!58
parents 18c9d13b 65560793
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ public class Checker {
     public static void main(String[] args) {
        //DirectedGraph<State> graph = new DirectedGraph<>();
        
        ArgumentParser argPars = ArgumentParser.of(args);
        ArgumentParser argPars = ArgumentParser.of(args, "Checker");
        BasicGraph basicGraphClass = new BasicGraph();
        DBinterface dbInterface;
        if(!argPars.isDutch()){
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class Corrector implements GUIListener {
    public static void main(String[] args) {
        //DirectedGraph<State> graph = new DirectedGraph<>();
        
        ArgumentParser argPars = ArgumentParser.of(args);
        ArgumentParser argPars = ArgumentParser.of(args, "Corrector");
        BasicGraph basicGraphClass = new BasicGraph();
        DBinterface dbInterface;
        WordPairDatabase wordPairDatabase;
+3 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ public class HashTableMaker {
    }

    public void updateDatabase(String phrase) throws SQLException, NoSuchAlgorithmException {
        phrase = phrase.replaceAll("[,.]", "");
        String hash = generateHash(phrase);

        PreparedStatement selectStatement = connection.prepareStatement("SELECT count FROM hashes WHERE hash = ?");
@@ -53,10 +54,9 @@ public class HashTableMaker {
            updateStatement.setString(2, hash);
            updateStatement.executeUpdate();
        } else {
            PreparedStatement insertStatement = connection.prepareStatement("INSERT INTO hashes (hash, count, phrase) VALUES (?, ?, ?)");
            PreparedStatement insertStatement = connection.prepareStatement("INSERT INTO hashes (hash, count) VALUES (?, ?)");
            insertStatement.setString(1, hash);
            insertStatement.setInt(2, 1);
            insertStatement.setString(3, phrase);
            insertStatement.executeUpdate();
        }
    }
@@ -95,6 +95,7 @@ public class HashTableMaker {
    }

    public int getCountForSentence(String sentence) throws SQLException, NoSuchAlgorithmException {
        sentence = sentence.replaceAll("[,.]", "");
        String hash = generateHash(sentence);

        PreparedStatement selectStatement = connection.prepareStatement("SELECT count FROM hashes WHERE hash = ?");
Loading