<commit_before>/**
 * @param {*} verseObjects 
 * @param {*} contextId 
 * @param {*} isWord 
 */
export const getWord = (verseObjects, contextId, isWord=false) => {
  let word = '';
  let separator = ' ';
  let inBetween = '';
  let greekWords = contextId.quote.split(' ');
  if (greekWords.indexOf(contextId.quote) < 0) {
    greekWords.push(contextId.quote);
  }
  verseObjects.forEach(verseObject => {
    if ((verseObject.type == 'milestone' || verseObject.type == 'word')) {
      if ((greekWords.indexOf(verseObject.content) >= 0 && verseObject.occurrence == contextId.occurrence) || isWord) {
        word += (word?separator:'');
        if (inBetween) {
          word += inBetween + " ";
        }
        if (verseObject.text) {
          word += verseObject.text;
          separator = ' ';
        }
        if (verseObject.children) {
          word += getWord(verseObject.children, contextId, true);
        }
      } else if (verseObject.children) {
        if (word) {
          inBetween += getWord(verseObject.children, contextId, true);
        } else {
          let childWord = getWord(verseObject.children, contextId);
          if (childWord) {
            word += (word?separator:'');
            word += childWord;
            separator = ' ';
          }
        }
      }
    } else if (verseObject.type == "text" && word) {
      if (separator == ' ') {
        separator = '';
      }
      separator += verseObject.text;
    }
  });
  return word;
};<commit_msg>Ellipses words that come inbetween<commit_after>/**
 * @param {*} verseObjects 
 * @param {*} contextId 
 * @param {*} isWord 
 */
export const getWord = (verseObjects, contextId, isWord=false) => {
  let word = '';
  let separator = ' ';
  let inBetween = false;
  let greekWords = contextId.quote.split(' ');
  if (greekWords.indexOf(contextId.quote) < 0) {
    greekWords.push(contextId.quote);
  }
  debugger;
  verseObjects.forEach(verseObject => {
    if ((verseObject.type == 'milestone' || verseObject.type == 'word')) {
      if ((greekWords.indexOf(verseObject.content) >= 0 && verseObject.occurrence == contextId.occurrence) || isWord) {
        if (inBetween) {
          separator += '... ';
          inBetween = false;
        }
        if (verseObject.text) {
          word += (word?separator:'') + verseObject.text;
          separator = ' ';
        }
        if (verseObject.children) {
          word += (word?separator:'') + getWord(verseObject.children, contextId, true);
          separator = ' ';
        }
      } else if (verseObject.children) {
        let childWord = getWord(verseObject.children, contextId, isWord);
        if (childWord) {
          if (inBetween) {
            separator += '... ';
            inBetween = false;
          }
          word += (word?separator:'') + childWord;
          separator = ' ';
        } else if (word) {
          inBetween = true;
        }
      }
    } else if (verseObject.type == "text" && word) {
      if (separator == ' ') {
        separator = '';
      }
      separator += verseObject.text;
    }
  });
  return word;
};
{'fraction_non_alphanumeric': 0.15516129032258064, 'fraction_numerical': 0.0012903225806451613, 'mean_word_length': 2.138663967611336, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4303991', 'n_tokens_mistral': 977, 'n_tokens_neox': 917, 'n_words': 187}