<commit_before>/**
The class for a Questionnaire
*/
import SequenceModel from './sequence.js';
import SurveyModel from './survey.js';
import ComponentGroupModel from './component-group.js';
import CodeListModel from './code-list';
import { stripLeadingUnderscore } from '../utils/name-utils';
import { normalizeField } from '../utils/data-json-utils';

class QuestionnaireModel extends SequenceModel {
  constructor(object) {
    super(object);
    if (object) {
      this._agency = object._agency;
      this._survey = new SurveyModel(object._survey);
      this._componentGroups = object._componentGroups.map(function(group) {
        return new ComponentGroupModel(group);
      })
      this._codeLists = {};
      this._codeLists._codeListSpecification = object._codeLists._codeListSpecification;
      this._codeLists._codeList = [];
      object._codeLists._codeList.forEach(cl => this._codeLists._codeList.push(new CodeListModel(cl)));
    } else {
      this._agency = 'fr.insee';
      // FIXME This is temporary
      var popoSurvey = new SurveyModel();<commit_msg>More cleaning on Questionnaire model<commit_after>/**
The class for a Questionnaire
*/
import SequenceModel from './sequence.js';
import SurveyModel from './survey.js';
import ComponentGroupModel from './component-group.js';
import CodeListModel from './code-list';

class QuestionnaireModel extends SequenceModel {
  constructor(object) {
    super(object);
    if (object) {
      this._agency = object._agency;
      this._survey = new SurveyModel(object._survey);
      this._componentGroups = object._componentGroups.map(function(group) {
        return new ComponentGroupModel(group);
      })
      this._codeLists = {};
      this._codeLists._codeListSpecification = object._codeLists._codeListSpecification;
      this._codeLists._codeList = [];
      object._codeLists._codeList.forEach(cl => this._codeLists._codeList.push(new CodeListModel(cl)));
    } else {
      this._agency = 'fr.insee';
      // FIXME This is temporary
      var popoSurvey = new SurveyModel();
{'fraction_non_alphanumeric': 0.11916342412451363, 'fraction_numerical': 0.0, 'mean_word_length': 3.6963470319634704, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2861897', 'n_tokens_mistral': 581, 'n_tokens_neox': 554, 'n_words': 127}