setMaxReturnedLanguages( intval( $options['a'] ) ); } if ( isset( $options['b'] ) ) { $cat->setLangBoostScore( floatval( $options['b'] ) ); } if ( !empty( $options['B'] ) ) { $cat->setBoostedLangs( explode( ",", $options['B'] ) ); } if ( !empty( $options['f'] ) ) { $cat->setMinFreq( intval( $options['f'] ) ); } if ( isset( $options['j'] ) ) { $cat->setMinInputLength( intval( $options['j'] ) ); } if ( !empty( $options['m'] ) ) { $cat->setMaxNgrams( intval( $options['m'] ) ); } if ( !empty( $options['p'] ) ) { $cat->setMaxProportion( floatval( $options['p'] ) ); } if ( !empty( $options['u'] ) ) { $cat->setResultsRatio( floatval( $options['u'] ) ); } if ( isset( $options['w'] ) ) { $cat->setWordSeparator( $options['w'] ); } $input = isset( $options['l'] ) ? $options['l'] : file_get_contents( "php://stdin" ); if ( !empty( $options['c'] ) ) { $result = $cat->classify( $input, explode( ",", $options['c'] ) ); } else { $result = $cat->classify( $input ); } if ( empty( $result ) ) { echo $cat->getResultStatus() . "\n"; exit( 1 ); } echo implode( " OR ", array_keys( $result ) ) . "\n"; exit( 0 );