protected function format_results( array $patterns, array $exceptions, array $comments ) {
		$pattern_mapping = [];

		foreach ( $patterns as $pattern ) {
			$segment = $this->get_segment( $pattern );

			if ( ! isset( $pattern_mapping[ $segment ] ) ) {
				$pattern_mapping[ $segment ] = $this->get_sequence( $pattern );
			}
		}

		// Produce a nice exceptions mapping.
		$json_exceptions = [];
		foreach ( $exceptions as $exception ) {
			$json_exceptions[ mb_strtolower( str_replace( '-', '', $exception ) ) ] = mb_strtolower( $exception );
		}

		$json_results = [
			'language'    => $this->language,
			'source_url'  => count( $this->urls ) > 1 ? $this->urls : $this->urls[0],
			'copyright'   => array_map( 'rtrim', $comments ),
			'exceptions'  => $json_exceptions,
			'patterns'    => $pattern_mapping,
		];

		return json_encode( $json_results, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE );
	}
protected function format_results( array $patterns, array $exceptions, array $comments ) {
		$pattern_mapping = [];

		foreach ( $patterns as $pattern ) {
			$segment = $this->get_segment( $pattern );

			if ( ! isset( $pattern_mapping[ $segment ] ) ) {
				$pattern_mapping[ $segment ] = $this->get_sequence( $pattern );
			}
		}

		// Produce a nice exceptions mapping.
		$json_exceptions = [];
		foreach ( $exceptions as $exception ) {
			$json_exceptions[ mb_strtolower( str_replace( '-', '', $exception ) ) ] = mb_strtolower( $exception );
		}

		$json_results = [
			'language'    => $this->language,
			'source_url'  => count( $this->urls ) > 1 ? $this->urls : $this->urls[0],
			'copyright'   => array_map( 'rtrim', $comments ),
			'exceptions'  => $json_exceptions,
			'patterns'    => $pattern_mapping,
		];

		return json_encode( $json_results, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE );
	}
protected function format_results ( array $ patterns , array $ exceptions , array $ comments ) { $ pattern_mapping = [ ] ; foreach ( $ patterns as $ pattern ) { $ segment = $ this -> get_segment ( $ pattern ) ; if ( ! isset ( $ pattern_mapping [ $ segment ] ) ) { $ pattern_mapping [ $ segment ] = $ this -> get_sequence ( $ pattern ) ; } } // Produce a nice exceptions mapping. $ json_exceptions = [ ] ; foreach ( $ exceptions as $ exception ) { $ json_exceptions [ mb_strtolower ( str_replace ( '-' , '' , $ exception ) ) ] = mb_strtolower ( $ exception ) ; } $ json_results = [ 'language' => $ this -> language , 'source_url' => count ( $ this -> urls ) > 1 ? $ this -> urls : $ this -> urls [ 0 ] , 'copyright' => array_map ( 'rtrim' , $ comments ) , 'exceptions' => $ json_exceptions , 'patterns' => $ pattern_mapping , ] ; return json_encode ( $ json_results , JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) ; }
Format hyphenation pattern file for wp-Typography.

@param array $patterns An array of TeX hyphenation patterns.
@param array $exceptions {
An array of hyphenation exceptions.

@type string $key Hyphenated key (e.g. 'something' => 'some-thing').
}
@param array $comments An array of TeX comments.

@return string
Format hyphenation pattern file for wp - Typography .