protected function _parseDefinition($definition)
    {
        $word = strtok($definition, '^');
        $similarWords = array_filter(explode('|', strtok('^')));

        return ['word' => $word, 'similarWords' => $similarWords];
    }
protected function _parseDefinition($definition)
    {
        $word = strtok($definition, '^');
        $similarWords = array_filter(explode('|', strtok('^')));

        return ['word' => $word, 'similarWords' => $similarWords];
    }
protected function _parseDefinition ( $ definition ) { $ word = strtok ( $ definition , '^' ) ; $ similarWords = array_filter ( explode ( '|' , strtok ( '^' ) ) ) ; return [ 'word' => $ word , 'similarWords' => $ similarWords ] ; }
Parses a single definition into its component pieces.

The format of a definition in a file is word[^similarWord|...].

@param string $definition The definition.
@return array The formatted definition.
Parses a single definition into its component pieces .