<commit_before>package at.ggjg.evg.gestures;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * Created by zelle on 30.01.2016.
 */
public class Sequence {

    private LinkedList<Integer> sequence;
    private SequenceName sequenceName;

    public Sequence(SequenceName sequenceName, int... sequence) {
        this.sequenceName = sequenceName;
        this.sequence = new LinkedList<Integer>();
        for (int sequ : sequence) {
            this.sequence.add(sequ);
        }
    }

   public int getSequenceMatch(LinkedList<Integer> draggedSequence){
       if(draggedSequence.size() == 0){
           return 0;
       }
       int hightestMatch = 0;
       int match = 0;
       int draggedSequItem = draggedSequence.get(0);
       for(int i=0, j=0; i < sequence.size() && j < draggedSequence.size(); i++){
           int sequItem = sequence.get(i);
           if(sequItem == draggedSequItem){
               match++;
               j++;
               draggedSequItem = j < draggedSequence.size() ? draggedSequence.get(j) : -1;
           } else {
               j=0;
               draggedSequItem = draggedSequence.get(j);
               if(hightestMatch < match){
                   hightestMatch = match;
               }
           }
       }
       if(hightestMatch < match){
           hightestMatch = match;
       }
       return hightestMatch;
   }

    public boolean isSequenceMatch(LinkedList<Integer> draggedSequence){
        int match = getSequenceMatch(draggedSequence);
        return match > 0 && match == sequence.size();
    }

    public SequenceName getSequenceName() {
        return sequenceName;
    }

    public enum SequenceName {
        SQUARE,
        CIRCLE,
        LINE, PENTAGON
    }
}
<commit_msg>exact match gesture ?<commit_after>package at.ggjg.evg.gestures;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * Created by zelle on 30.01.2016.
 */
public class Sequence {

    private LinkedList<Integer> sequence;
    private SequenceName sequenceName;

    public Sequence(SequenceName sequenceName, int... sequence) {
        this.sequenceName = sequenceName;
        this.sequence = new LinkedList<Integer>();
        for (int sequ : sequence) {
            this.sequence.add(sequ);
        }
    }

   public int getSequenceMatch(LinkedList<Integer> draggedSequence){
       if(draggedSequence.size() == 0){
           return 0;
       }
       int hightestMatch = 0;
       int match = 0;
       int draggedSequItem = draggedSequence.get(0);
       for(int i=0, j=0; i < sequence.size() && j < draggedSequence.size(); i++){
           int sequItem = sequence.get(i);
           if(sequItem == draggedSequItem){
               match++;
               j++;
               draggedSequItem = j < draggedSequence.size() ? draggedSequence.get(j) : -1;
           } else {
               j=0;
               draggedSequItem = draggedSequence.get(j);
               if(hightestMatch < match){
                   hightestMatch = match;
               }
           }
//          comment in if exact match is needed
//           if(draggedSequence.size() >= (j+1)){
//               return 0;
//           }
       }
       if(hightestMatch < match){
           hightestMatch = match;
       }
       return hightestMatch;
   }

    public boolean isSequenceMatch(LinkedList<Integer> draggedSequence){
        int match = getSequenceMatch(draggedSequence);
        return match > 0 && match == sequence.size();
    }

    public SequenceName getSequenceName() {
        return sequenceName;
    }

    public enum SequenceName {
        SQUARE,
        CIRCLE,
        LINE, PENTAGON
    }
}

{'fraction_non_alphanumeric': 0.1064991807755325, 'fraction_numerical': 0.010376843255051884, 'mean_word_length': 1.9048374306106264, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6191231', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1004, 'n_words': 234}