<commit_before>import { Injectable } from '@angular/core';
import { DynamicFormControlModel, DynamicInputModel } from '@ng2-dynamic-forms/core';

@Injectable()
export class FormFactoryService {

  createFormModel(properties: Map<string, any>): DynamicFormControlModel[] {
    const answer = <DynamicFormControlModel[]>[];
    for (const key in properties) {
      if (!properties.hasOwnProperty(key)) {
        continue;
      }
      const value: any = properties[key];
      let formField: any;
      let type = (value.type || '').toLowerCase();
      switch (value.type.toLowerCase()) {
        case 'string':
        case 'text':
        case 'number':
        case 'boolean':
        case 'password':
        case 'java.lang.string':
          if (type === 'java.lang.string') {
            type = 'text';
          }
          formField = new DynamicInputModel({
            id: value.name || key,
            label: value.title || value.label,
            hint: value.description,
            inputType: type,
          });<commit_msg>Use best option for form labels<commit_after>import { Injectable } from '@angular/core';
import { DynamicFormControlModel, DynamicInputModel } from '@ng2-dynamic-forms/core';

@Injectable()
export class FormFactoryService {

  createFormModel(properties: Map<string, any>): DynamicFormControlModel[] {
    const answer = <DynamicFormControlModel[]>[];
    for (const key in properties) {
      if (!properties.hasOwnProperty(key)) {
        continue;
      }
      const value: any = properties[key];
      let formField: any;
      let type = (value.type || '').toLowerCase();
      switch (value.type.toLowerCase()) {
        case 'string':
        case 'text':
        case 'number':
        case 'boolean':
        case 'password':
        case 'java.lang.string':
          if (type === 'java.lang.string') {
            type = 'text';
          }
          formField = new DynamicInputModel({
            id: value.name || key,
            label: value.title || value.displayName || value.name || key,
            hint: value.description,
            inputType: type,
          });
{'fraction_non_alphanumeric': 0.13104744011272898, 'fraction_numerical': 0.0009394081728511038, 'mean_word_length': 2.3437990580847723, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '795606', 'n_tokens_mistral': 577, 'n_tokens_neox': 578, 'n_words': 149}