<commit_before>import { Component, OnInit, ViewChildren, QueryList } from '@angular/core';
import { MultitextComponent } from '../multitext/multitext.component';
@Component({
  moduleId: module.id,
  selector: 'worddetails',
  templateUrl: 'word-details.component.html',
  styleUrls: ['word-details.component.css'],

})

export class WordDetailsComponent implements OnInit {

  @ViewChildren(MultitextComponent) multitextBoxes: QueryList<MultitextComponent>;
  showDetails: Boolean=false;
  detailLabels: any[] = ["Citation Form", "Pronunciation", "CV Pattern", "Tone"];
  id="12345"
  constructor() { }

  ngOnInit() {}
  toggleShowDetails() {
    if (this.showDetails){
      this.showDetails=false;
    }
    else{
      this.showDetails=true;
    }
  }
  sendEntry() {
    console.log("sendEntry called");
    console.log(this.getAllMultitextBoxes())
    // lex_entry_update(this.getAllMultitextBoxes());
  }
  getAllMultitextBoxes() {
    let rtn: any = [];
    if(this.id){
      rtn.push({id: this.id
    })}
    this.multitextBoxes.forEach(function(multitextBox) {
      rtn.push({label: multitextBox.label,
        content: multitextBox.content});
    });
    return rtn;
  }
}<commit_msg>feature/rw-add-entry: wip adding/updating entries<commit_after>import { Component, OnInit, ViewChildren, QueryList } from '@angular/core';
import { MultitextComponent } from '../multitext/multitext.component';
@Component({
  moduleId: module.id,
  selector: 'worddetails',
  templateUrl: 'word-details.component.html',
  styleUrls: ['word-details.component.css'],

})

export class WordDetailsComponent implements OnInit {

  @ViewChildren(MultitextComponent) multitextBoxes: QueryList<MultitextComponent>;
  showDetails: Boolean=false;
  detailLabels: any[] = ["Citation Form", "Pronunciation", "CV Pattern", "Tone"];
  id="12345"
  constructor() { }

  ngOnInit() {}
  toggleShowDetails() {
    if (this.showDetails){
      this.showDetails=false;
    }
    else{
      this.showDetails=true;
    }
  }
  sendEntry() {
    console.log("sendEntry called");
    console.log(this.getAllMultitextBoxes())
    // lex_entry_update(this.getAllMultitextBoxes());
  }
  getAllMultitextBoxes() {
    let rtn: any = [];
    let count: number = 0;
    if(this.id){
      rtn.push({id: this.id
    })}
    this.multitextBoxes.forEach(function(multitextBox) {
      if (count == 0){
        rtn.push({"lexeme": {
          "th":{
            "value": multitextBox.content
          }
        },
        })
      }
      else{
        rtn.push({"senses": [
          {
            "guid": "5f4b0cd9-a6da-4c71-9e3b-eff03aacd61d",
            "definition":{
              "en":{
                "value": multitextBox.content
              }
            }
          }
        ]
      })}
      count+=1;
    });
    return rtn;
  }
}
{'fraction_non_alphanumeric': 0.14706927175843695, 'fraction_numerical': 0.009591474245115453, 'mean_word_length': 2.9384615384615387, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 5, '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': '5941044', 'n_tokens_mistral': 958, 'n_tokens_neox': 926, 'n_words': 151}