<commit_before>import {Component, Input, SimpleChange, OnChanges} from 'angular2/core';
import {IdaiFieldObject} from "../model/idai-field-object";
import {Datastore} from "../services/datastore";

/**
 * @author <NAME>
 * @author <NAME>
 */
@Component({

    selector: 'object-edit',
    templateUrl: 'templates/object-edit.html'
})

export class ObjectEditComponent implements OnChanges {

    @Input() selectedObject: IdaiFieldObject;
    private saveTimer: number;
    private changed: boolean;

    constructor(private datastore: Datastore) { }

    /**
     * Saves the currently selected object to the local datastore.
     */
    private saveSelected() {
        this.save(this.selectedObject);
    }

    /**
     * Saves the object to the local datastore.
     * @param object
     */
    private save(object: IdaiFieldObject) {<commit_msg>Add comment.<commit_after>import {Component, Input, SimpleChange, OnChanges} from 'angular2/core';
import {IdaiFieldObject} from "../model/idai-field-object";
import {Datastore} from "../services/datastore";

/**
 * @author <NAME>
 * @author <NAME>
 */
@Component({

    selector: 'object-edit',
    templateUrl: 'templates/object-edit.html'
})

export class ObjectEditComponent implements OnChanges {

    @Input() selectedObject: IdaiFieldObject;
    private saveTimer: number;
    private changed: boolean; // indicates that the currently edited object differs from the one
                              // saved on the local datastore.

    constructor(private datastore: Datastore) { }

    /**
     * Saves the currently selected object to the local datastore.
     */
    private saveSelected() {
        this.save(this.selectedObject);
    }

    /**
     * Saves the object to the local datastore.
     * @param object
     */
    private save(object: IdaiFieldObject) {
{'fraction_non_alphanumeric': 0.1180973209404046, 'fraction_numerical': 0.0010934937124111536, 'mean_word_length': 3.130925507900677, 'pattern_counts': {'":': 0, '<': 7, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7547759', 'n_tokens_mistral': 526, 'n_tokens_neox': 520, 'n_words': 146}