createIndex(fileName) {
    if (Object.hasOwnProperty.call(this.files, fileName)) {
      const currentFileContent = this.files[fileName];
      this.indexTable[fileName] = this.indexTable[fileName] || {};
      const fileLength = this.files[fileName].length;
      for (let docIndex = 0; docIndex < fileLength; docIndex += 1) {
        const currentFileDoc = currentFileContent[docIndex];
        const docTitle = currentFileDoc.title;
        const docText = currentFileDoc.text;
        const docToken = InvertedIndexUtilities
          .getCleanTokens(`${docText} ${docTitle}`);
        docToken.forEach((word) => {
          if (word in this.indexTable[fileName]) {
            if (this.indexTable[fileName][word].indexOf(docIndex) === -1) {
              this.indexTable[fileName][word].push(docIndex);
            }
          } else {
            this.indexTable[fileName][word] = [docIndex];
          }
        });
      }
    } else {
      return false;
    }
    return true;
  }
/**
   * createIndex
   * @param {Object} fileName name of file to map index for
   * @return {Boolean} false if index is not created
   */
createIndex
@param {Object} fileName name of file to map index for
@return {Boolean} false if index is not created
createIndex @param { Object } fileName name of file to map index for @return { Boolean } false if index is not created
createIndex(fileName) {
    if (Object.hasOwnProperty.call(this.files, fileName)) {
      const currentFileContent = this.files[fileName];
      this.indexTable[fileName] = this.indexTable[fileName] || {};
      const fileLength = this.files[fileName].length;
      for (let docIndex = 0; docIndex < fileLength; docIndex += 1) {
        const currentFileDoc = currentFileContent[docIndex];
        const docTitle = currentFileDoc.title;
        const docText = currentFileDoc.text;
        const docToken = InvertedIndexUtilities
          .getCleanTokens(`${docText} ${docTitle}`);
        docToken.forEach((word) => {
          if (word in this.indexTable[fileName]) {
            if (this.indexTable[fileName][word].indexOf(docIndex) === -1) {
              this.indexTable[fileName][word].push(docIndex);
            }
          } else {
            this.indexTable[fileName][word] = [docIndex];
          }
        });
      }
    } else {
      return false;
    }
    return true;
  }
createIndex ( fileName ) { if ( Object . hasOwnProperty . call ( this . files , fileName ) ) { const currentFileContent = this . files [ fileName ] ; this . indexTable [ fileName ] = this . indexTable [ fileName ] || { } ; const fileLength = this . files [ fileName ] . length ; for ( let docIndex = 0 ; docIndex < fileLength ; docIndex += 1 ) { const currentFileDoc = currentFileContent [ docIndex ] ; const docTitle = currentFileDoc . title ; const docText = currentFileDoc . text ; const docToken = InvertedIndexUtilities . getCleanTokens ( ` ${ docText } ${ docTitle } ` ) ; docToken . forEach ( ( word ) => { if ( word in this . indexTable [ fileName ] ) { if ( this . indexTable [ fileName ] [ word ] . indexOf ( docIndex ) === - 1 ) { this . indexTable [ fileName ] [ word ] . push ( docIndex ) ; } } else { this . indexTable [ fileName ] [ word ] = [ docIndex ] ; } } ) ; } } else { return false ; } return true ; }
createIndex
 @param {Object} fileName name of file to map index for
 @return {Boolean} false if index is not created
createIndex @param { Object } fileName name of file to map index for @return { Boolean } false if index is not created