2017 © Pedro PelĂĄez
 

symfony-bundle simstring-bundle

Mapado Simstring Bundle: Record search

image

mapado/simstring-bundle

Mapado Simstring Bundle: Record search

  • Friday, December 19, 2014
  • by jdeniau
  • Repository
  • 12 Watchers
  • 3 Stars
  • 2,203 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

SimstringBundle

Mapado SimstringBundle : Symfony bundle for simstring record search, (*1)

Installation

This extension use Simstring. You can find a description of how we use it on mapado.com on our blog., (*2)

You have to install Simsting PHP Extension to make this bundle working., (*3)

Get the bundle

Add this in your composer.json, (*4)

{
    "require": {
        "mapado/simstring-bundle": "1.*"
    }
}

and then run, (*5)

php composer.phar update

or, (*6)

composer update

if you installed composer globally., (*7)

Add the classes to your kernel

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Mapado\SimstringBundle\MapadoSimstringBundle(),
    );
}

Configuration

Declare your databases

# app/config/config.yml
mapado_simstring:
    databases:
        city: "path/to/your/database/city.db"
        country: "path/to/your/database/country.db"

Declare your readers

# app/config/config.yml
mapado_simstring:
    databases:
        city: "path/to/your/database/city.db"
        country: "path/to/your/database/country.db"
    reader:
        city_cosine:
            database: city
            measure: cosine # values are cosine/dice/jaccard/overlap/exact
            threshold: 0.7 # float between 0 and 1
            min_results: 1 # minimim number of results if you have a lower threshold limit
        # you can add as many reader you like

Declare your writers

# app/config/config.yml
mapado_simstring:
    databases:
        city: "path/to/your/database/city.db"
        country: "path/to/your/database/country.db"
    reader:
        city:
            database: city
            measure: cosine # values are cosine/dice/jaccard/overlap/exact (default is: exact)
            threshold: 0.7 # float between 0 and 1
            min_results: 1 # minimim number of results if you have a lower threshold limit
        # you can add as many reader you like

    writer:
        city:
            database: city
            unicode: false # not required
            ngram: 3 # not required
            be: false # not required

SimstringBundle is compatible with Doctrine ORM. You only add a few database settings to get objects from your database., (*8)

# app/config/config.yml
mapado_simstring:
    databases:
        city: 
            path: "path/to/your/database/city.db"
            persistence:
                driver: orm # only ORM is supported for the moment
                model: \Mapado\MyEntityBundle\Entity\City # required
                field: simstringColumn # required
                options: # optional
                    manager: geolocation # if not set, the default manager will be used
                    repository_method: findVisibleBy # findBy is used by default
````




### Usage
You can now use the functions in your controllers or via command line

#### Command Line
```sh
# Perform the query
php app/console mapado:simstring:search city cihcago
# will output chicago

# Perform an insert
php app/console mapado:simstring:insert city chicago houson boston montréal
# will rewrite the database with this cities

Controller

// Perform the query
$resultList = $this->get('mapado.simstring.city_reader')->find('New Yrok');

// Dynamically change the threshold
$resultList = $this->get('mapado.simstring.city_reader')->find('New Yrok', 0.3);

$resultList will be an iterator of SimstringResult having a string (or an Entity if you used the ORM mapper) as value., (*9)

The Versions

19/12 2014

dev-master

9999999-dev

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

19/12 2014

v1.1.1

1.1.1.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

19/12 2014

v1.1.0

1.1.0.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

03/12 2013

v1.0.0

1.0.0.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

02/12 2013

v0.4.1

0.4.1.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

02/12 2013

v0.4.0

0.4.0.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

13/11 2013

v0.3.2

0.3.2.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

08/11 2013

v0.3.1

0.3.1.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

08/11 2013

v0.3.0

0.3.0.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

06/11 2013

v0.2.2

0.2.2.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

08/08 2013

v0.2.1

0.2.1.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

08/08 2013

v0.2.0

0.2.0.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony mapado simstring record search

07/08 2013

v0.1.1

0.1.1.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

symfony mapado simstring record search

07/08 2013

v0.1.0

0.1.0.0

Mapado Simstring Bundle: Record search

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

symfony mapado simstring record search