<commit_before>package com.mrkevinthomas.kcards.models;

import android.os.Parcel;
import android.os.Parcelable;

import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.ForeignKey;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
import com.raizlabs.android.dbflow.structure.BaseModel;

@Table(database = AppDatabase.class)
public class Card extends BaseModel implements Parcelable {

    @Column
    @PrimaryKey(autoincrement = true)
    long id;

    @ForeignKey(tableClass = Deck.class)
    long deckId;

    @Column
    long createdTimeMs;

    @Column
    long updatedTimeMs;

    @Column
    String frontText;

    @Column
    String backText;

    @Column
    String frontLanguageCode;

    @Column
    String backLanguageCode;

    @Column
    int correctCount;

    @Column
    int incorrectCount;

    public Card() {
    }

    public Card(long deckId, String frontText, String backText) {
        this.deckId = deckId;
        this.frontText = frontText;
        this.backText = backText;
    }

    @Override
    public void save() {
        if (createdTimeMs == 0) {
            createdTimeMs = System.currentTimeMillis();
        }
        updatedTimeMs = System.currentTimeMillis();
        super.save();
    }

    public void setDeckId(long deckId) {
        this.deckId = deckId;
    }

    public String getFrontText() {
        return frontText;
    }

    public String getBackText() {
        return backText;
    }

    public void setFrontText(String frontText) {
        this.frontText = frontText;
    }

    public void setBackText(String backText) {
        this.backText = backText;
    }

    public Language getFrontLanguage() {
        return Language.fromCode(frontLanguageCode);
    }

    public Language getBackLanguage() {
        return Language.fromCode(backLanguageCode);
    }

    public int getCorrectCount() {
        return correctCount;
    }

    public int getIncorrectCount() {
        return incorrectCount;
    }

    public void incrementCorrect() {
        correctCount++;
        save();
    }

    public void incrementIncorrect() {
        incorrectCount++;
        save();
    }

    public void resetProgress() {
        correctCount = 0;
        incorrectCount = 0;
        save();
    }<commit_msg>updated Card model to jive with firebase db syncing<commit_after>package com.mrkevinthomas.kcards.models;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.firebase.database.Exclude;
import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.ForeignKey;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
import com.raizlabs.android.dbflow.structure.BaseModel;

@Table(database = AppDatabase.class)
public class Card extends BaseModel implements Parcelable {

    @Column
    @PrimaryKey(autoincrement = true)
    long id;

    @ForeignKey(tableClass = Deck.class)
    long deckId;

    @Column
    long createdTimeMs;

    @Column
    long updatedTimeMs;

    @Column
    String frontText;

    @Column
    String backText;

    @Column
    String frontLanguageCode;

    @Column
    String backLanguageCode;

    @Column
    int correctCount;

    @Column
    int incorrectCount;

    public Card() {
    }

    public Card(long deckId, String frontText, String backText) {
        this.deckId = deckId;
        this.frontText = frontText;
        this.backText = backText;
    }

    @Override
    public void save() {
        if (createdTimeMs == 0) {
            createdTimeMs = System.currentTimeMillis();
        }
        updatedTimeMs = System.currentTimeMillis();
        super.save();
    }

    public void setDeckId(long deckId) {
        this.deckId = deckId;
    }

    public long getCreatedTimeMs() {
        return createdTimeMs;
    }

    public long getUpdatedTimeMs() {
        return updatedTimeMs;
    }

    public String getFrontText() {
        return frontText;
    }

    public String getBackText() {
        return backText;
    }

    public void setFrontText(String frontText) {
        this.frontText = frontText;
    }

    public void setBackText(String backText) {
        this.backText = backText;
    }

    public String getFrontLanguageCode() {
        return frontLanguageCode;
    }

    public String getBackLanguageCode() {
        return backLanguageCode;
    }

    @Exclude
    public Language getFrontLanguage() {
        return Language.fromCode(frontLanguageCode);
    }

    @Exclude
    public Language getBackLanguage() {
        return Language.fromCode(backLanguageCode);
    }

    public int getCorrectCount() {
        return correctCount;
    }

    public int getIncorrectCount() {
        return incorrectCount;
    }

    public void incrementCorrect() {
        correctCount++;
        save();
    }

    public void incrementIncorrect() {
        incorrectCount++;
        save();
    }

    public void resetProgress() {
        correctCount = 0;
        incorrectCount = 0;
        save();
    }
{'fraction_non_alphanumeric': 0.0863239573229874, 'fraction_numerical': 0.0011639185257032007, 'mean_word_length': 2.509870660313138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6343654', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1482, 'n_words': 334}