# Module: wordArrayParsing

Contains all system defined business rules for parsing arrays specific to words.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2021-… by Seth Hollingsead. All rights reserved
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 1

### Requires

- module:ruleParsing
- module:loggers
- @haystacks/constants
- path

### Methods

#### (inner) ascertainMatchingElements(inputData, inputMetaData) → {boolean}

Determines if to values are identical. Needed for completeness of comparison for nested arrays.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<(string|boolean|integer|float|object)> | An array that should be compared for equality.
`inputMetaData` | array.<(string|boolean|integer|float|object)> | Second array that should be compared for equality.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 200

##### Returns:

True or False to indicate array equality or not.

Type
  boolean

#### (inner) convertArrayToCamelCaseString(inputData, inputMetaData) → {string}

Takes an array of words and returns a camelCase string of the input words.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | The array of words that should be strung together into a single long string.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 137

##### Returns:

A string that contains all of the words from the input array put together in sequential order.

Type
  string

#### (inner) convertCamelCaseStringToArray(inputData, inputMetaData) → {array.<string>}

Takes a string in camelCase and returns an array of the words.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | String to decompose into an array.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 26

##### Returns:

The array of words that were composed in the original string.

Type
  array.<string>

#### (inner) doesArrayContainLowerCaseConsolidatedString(inputData, inputMetaData) → {boolean}

Checks if an array contains a string, comparison made by lowerCaseAndConsolidatedString().

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | The array of strings that should be checked if it contains the specified string.
`inputMetaData` | string | The string we are looking for in the array.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 161

##### Returns:

A Boolean to indicate if the string is found in the array or not.

Type
  boolean

#### (inner) getWordsArrayFromString(inputData, inputMetaData) → {array.<string>}

Gets an array of words from a string, automatically determining how the words are delimited based on common word delimiters: camel case, space, period, dash & underscore.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should be broken down into words and returned as an array.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 65

##### Returns:

The array of words found in the string.

Type
  array.<string>

#### (inner) recombineStringArrayWithSpaces(inputData, inputMetaData) → {string}

Takes an array of strings and recombines them sequentially ith spaces between each array element. This function is needed, because commands parse inputs by spaces ino an array, and some commands need a single continuous string that might be delimited by coma's. So this function lets us recombine and teh re-parse the string with another delimiter.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | The array of strings that should be recombined.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/wordArrayParsing.js, line 107

##### Returns:

The string array with spaces between array elements.

Type
  string