<commit_before>import {Component, Input} from 'angular2/core';
import {CardService} from '../../foundation/services/card.service'
import {CardTypeFieldComponent} from './card-type-field.component'
import {CardStatFieldComponent} from './card-stat-field.component'

@Component({
    selector: 'revision-form',
    templateUrl: 'app/cards/components/revision-form.component.html',
    directives: [CardTypeFieldComponent, CardStatFieldComponent]
})
export class RevisionFormComponent {
    constructor(private _cardService: CardService) { }

    @Input() revision: [string: any];
    ngOnInit() {
        if (!this.revision) {
            this.revision = {stats: []};
        }
    }

    modifyStats(newStats) {
        this.revision.stats = newStats;
    }

    submitClicked() {
        this._cardService.saveRevision(this.revision).subscribe(
            // TODO: Show these to the user.
            data => console.log("Saved"),
            err => console.error(err)
        );
    }
}<commit_msg>Added architecture TODO<commit_after>import {Component, Input} from 'angular2/core';
import {CardService} from '../../foundation/services/card.service'
import {CardTypeFieldComponent} from './card-type-field.component'
import {CardStatFieldComponent} from './card-stat-field.component'

@Component({
    selector: 'revision-form',
    templateUrl: 'app/cards/components/revision-form.component.html',
    directives: [CardTypeFieldComponent, CardStatFieldComponent]
})
export class RevisionFormComponent {
    constructor(private _cardService: CardService) { }

    @Input() revision: [string: any];
    ngOnInit() {
        if (!this.revision) {
            this.revision = {stats: []};
        }
    }

    modifyStats(newStats) {
        this.revision.stats = newStats;
    }

    submitClicked() {
        this._cardService.saveRevision(this.revision).subscribe(
            // TODO: Show these to the user.
            // TODO: Emit a signal that passes the new revision to the parent
            data => console.log("Saved"),
            err => console.error(err)
        );
    }
}
{'fraction_non_alphanumeric': 0.13170498084291188, 'fraction_numerical': 0.0009578544061302681, 'mean_word_length': 2.9415094339622643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7555118', 'n_tokens_mistral': 598, 'n_tokens_neox': 592, 'n_words': 124}