public function set_custom_exceptions( array $exceptions = [] ) {
		if ( empty( $exceptions ) && empty( $this->custom_exceptions ) ) {
			return; // Nothing to do at all.
		}

		// Calculate hash & check against previous exceptions.
		$new_hash = self::get_object_hash( $exceptions );
		if ( $this->custom_exceptions_hash === $new_hash ) {
			return; // No need to update exceptions.
		}

		// Do our thing.
		$exception_keys = [];
		foreach ( $exceptions as $exception ) {
			$f = Strings::functions( $exception );
			if ( empty( $f ) ) {
				continue; // unknown encoding, abort.
			}

			$exception                    = $f['strtolower']( $exception );
			$exception_keys[ $exception ] = \preg_replace( "#-#{$f['u']}", '', $exception );
		}

		// Update exceptions.
		$this->custom_exceptions      = \array_flip( $exception_keys );
		$this->custom_exceptions_hash = $new_hash;

		// Force remerging of patgen and custom exception patterns.
		$this->merged_exception_patterns = null;
	}
public function set_custom_exceptions( array $exceptions = [] ) {
		if ( empty( $exceptions ) && empty( $this->custom_exceptions ) ) {
			return; // Nothing to do at all.
		}

		// Calculate hash & check against previous exceptions.
		$new_hash = self::get_object_hash( $exceptions );
		if ( $this->custom_exceptions_hash === $new_hash ) {
			return; // No need to update exceptions.
		}

		// Do our thing.
		$exception_keys = [];
		foreach ( $exceptions as $exception ) {
			$f = Strings::functions( $exception );
			if ( empty( $f ) ) {
				continue; // unknown encoding, abort.
			}

			$exception                    = $f['strtolower']( $exception );
			$exception_keys[ $exception ] = \preg_replace( "#-#{$f['u']}", '', $exception );
		}

		// Update exceptions.
		$this->custom_exceptions      = \array_flip( $exception_keys );
		$this->custom_exceptions_hash = $new_hash;

		// Force remerging of patgen and custom exception patterns.
		$this->merged_exception_patterns = null;
	}
public function set_custom_exceptions ( array $ exceptions = [ ] ) { if ( empty ( $ exceptions ) && empty ( $ this -> custom_exceptions ) ) { return ; // Nothing to do at all. } // Calculate hash & check against previous exceptions. $ new_hash = self :: get_object_hash ( $ exceptions ) ; if ( $ this -> custom_exceptions_hash === $ new_hash ) { return ; // No need to update exceptions. } // Do our thing. $ exception_keys = [ ] ; foreach ( $ exceptions as $ exception ) { $ f = Strings :: functions ( $ exception ) ; if ( empty ( $ f ) ) { continue ; // unknown encoding, abort. } $ exception = $ f [ 'strtolower' ] ( $ exception ) ; $ exception_keys [ $ exception ] = \ preg_replace ( "#-#{$f['u']}" , '' , $ exception ) ; } // Update exceptions. $ this -> custom_exceptions = \ array_flip ( $ exception_keys ) ; $ this -> custom_exceptions_hash = $ new_hash ; // Force remerging of patgen and custom exception patterns. $ this -> merged_exception_patterns = null ; }
Sets custom word hyphenations.

@param array $exceptions Optional. An array of words with all hyphenation points marked with a hard hyphen. Default empty array.
Sets custom word hyphenations .