src/StopwordAnalyzer/CdbStopwordAnalyzer.php
public static function createCdbByLanguage( $location, $language ) {

		$language = strtolower( $language );
		$source = $location . $language . '.json';

		if ( !file_exists( $source ) ) {
			throw new RuntimeException( "{$source} is not available." );
		}

		$contents = json_decode( file_get_contents( $source ), true );

		if ( !isset( $contents['list'] ) ) {
			throw new RuntimeException( "JSON is missing the `list` index." );
		}

		$writer = Writer::open(
			self::getTargetByLanguage( $language )
		);

		foreach ( $contents['list'] as $words ) {
			$writer->set( trim( $words ), true );
		}

		$writer->close();

		return true;
	}
public static function createCdbByLanguage( $location, $language ) {

		$language = strtolower( $language );
		$source = $location . $language . '.json';

		if ( !file_exists( $source ) ) {
			throw new RuntimeException( "{$source} is not available." );
		}

		$contents = json_decode( file_get_contents( $source ), true );

		if ( !isset( $contents['list'] ) ) {
			throw new RuntimeException( "JSON is missing the `list` index." );
		}

		$writer = Writer::open(
			self::getTargetByLanguage( $language )
		);

		foreach ( $contents['list'] as $words ) {
			$writer->set( trim( $words ), true );
		}

		$writer->close();

		return true;
	}
@since 0.1

@param string $location
@param string $language

@return boolean