eoko/text-kernel

There is no license information available for the latest version (1.0.1) of this package.

1.0.1 2017-11-27 09:27 UTC

This package is not auto-updated.

Last update: 2024-12-13 03:39:34 UTC


README

This is a small implementation of the sourcebox extract API
Contributions are welcome.

Usage with Symfony

Configuration

In your service.yml

    textkernel.factory:
        class: Eoko\TextKernel\Factory\TextKernelFactory
        
    textkernel.api.servicebox:
        class: Eoko\TextKernel\Api\SourceboxApi
        factory: [ '@textkernel.factory', createSourceboxApi ]
        arguments:
            - '%textkernel_account%'
            - '%textkernel_username%'
            - '%textkernel_password%'

In your parameters.yml

parameters:
    textkernel_account: change_me
    textkernel_username: change_me
    textkernel_password: ######

Usage

In a container aware class

    $api = $this->get('textkernel.api.servicebox');
    
    try {
        /** @param \Eoko\TextKernel\Model\CvModel $cv */
        $cv = $api->extractFromFile($filepath);
        // or
        $cv = $api->extract($cvBuffer);
    } catch(\Exception $e) {
        //handle errors
    }

Raw usage

    use Eoko\TextKernel\Factory\TextKernelFactory;
    
    $account = 'change_me';
    $username = 'change_me';
    $password = '########';
    
    $factory = new TextKernelFactory();
    $api = $factory->createSourceboxApi($account, $username, $password);
    
    try {
        /** @param \Eoko\TextKernel\Model\CvModel $cv */
        $cv = $api->extractFromFile($filepath);
        // or
        $cv = $api->extract($cvBuffer);
    } catch(\Exception $e) {
        //handle errors
    }