public function get_words( $abc = self::ALLOW_ALL_LETTERS, $caps = self::ALLOW_ALL_CAPS, $comps = self::ALLOW_COMPOUNDS ) {
		// Return early if no text has been loaded.
		if ( empty( $this->text ) ) {
			return []; // abort.
		}

		// Result set.
		$tokens = [];

		foreach ( $this->get_type( Token::WORD ) as $index => $token ) {

			if (
				$this->conforms_to_letters_policy( $token, $abc ) &&
				$this->conforms_to_caps_policy( $token, $caps ) &&
				$this->conforms_to_compounds_policy( $token, $comps )
			) {
				$tokens[ $index ] = $token;
			}
		}

		return $tokens;
	}
public function get_words( $abc = self::ALLOW_ALL_LETTERS, $caps = self::ALLOW_ALL_CAPS, $comps = self::ALLOW_COMPOUNDS ) {
		// Return early if no text has been loaded.
		if ( empty( $this->text ) ) {
			return []; // abort.
		}

		// Result set.
		$tokens = [];

		foreach ( $this->get_type( Token::WORD ) as $index => $token ) {

			if (
				$this->conforms_to_letters_policy( $token, $abc ) &&
				$this->conforms_to_caps_policy( $token, $caps ) &&
				$this->conforms_to_compounds_policy( $token, $comps )
			) {
				$tokens[ $index ] = $token;
			}
		}

		return $tokens;
	}
public function get_words ( $ abc = self :: ALLOW_ALL_LETTERS , $ caps = self :: ALLOW_ALL_CAPS , $ comps = self :: ALLOW_COMPOUNDS ) { // Return early if no text has been loaded. if ( empty ( $ this -> text ) ) { return [ ] ; // abort. } // Result set. $ tokens = [ ] ; foreach ( $ this -> get_type ( Token :: WORD ) as $ index => $ token ) { if ( $ this -> conforms_to_letters_policy ( $ token , $ abc ) && $ this -> conforms_to_caps_policy ( $ token , $ caps ) && $ this -> conforms_to_compounds_policy ( $ token , $ comps ) ) { $ tokens [ $ index ] = $ token ; } } return $ tokens ; }
Retrieves all tokens of the type "word".

@param int $abc   Optional. Handling of all-letter words. Allowed values NO_ALL_LETTERS, ALLOW_ALL_LETTERS, REQUIRE_ALL_LETTERS. Default ALLOW_ALL_LETTERS.
@param int $caps  Optional. Handling of capitalized words (setting does not affect non-letter characters). Allowed values NO_ALL_CAPS, ALLOW_ALL_CAPS, REQUIRE_ALL_CAPS. Default ALLOW_ALL_CAPS.
@param int $comps Optional. Handling of compound words (setting does not affect all-letter words). Allowed values NO_COMPOUNDS, ALLOW_COMPOUNDS, REQUIRE_COMPOUNDS. Default ALLOW_COMPOUNDS.

@return Token[] An array of numerically indexed tokens.
Retrieves all tokens of the type word .