Git Product home page Git Product logo

cleaner's Introduction

Cleaner

Build Status

A lib to clean domains and company names. It also can extract the acronym of the company (or try to)

Install

composer require const-g/cleaner

Usage:

It removes common 'company' terms in different languages (not all yet)

<?php
$company_name = \Constg\Cleaner\Clean::company_names('Google inc.');
// array(
//     'original_name' => $company_name,
//     'split' => array('google'),
//     'clean_name' => 'google',
//     'clean_name_no_space' => 'google',
// );

It also removes country name

<?php
$company_name = \Constg\Cleaner\Clean::company_names('Google France');
// array(
//     'original_name' => $company_name,
//     'split' => array('google'),
//     'clean_name' => 'google',
//     'clean_name_no_space' => 'google',
// );
Known bug: does not cover company name like "Electricité de France" as 
it will be converted to "electricite" only.

Can recompose spaced acronym

<?php
$company_name = \Constg\Cleaner\Clean::company_names('B.M.W Group');
// array(
//     'original_name' => 'B.M.W Group',
//     'split' => array('bmw'),
//     'clean_name' => 'bmw',
//     'clean_name_no_space' => 'bmw',
// );

If the acronym is present, then it extract it from the name, if it matches the rest of the name

<?php
$company_name = \Constg\Cleaner\Clean::company_names('COMPAGNIE GENERALE DES ETABLISSEMENTS MICHELIN (C G E M)');
// array(
//     'original_name' => 'COMPAGNIE GENERALE DES ETABLISSEMENTS MICHELIN (C G E M)',
//     'split' => array('compagnie', 'etablissements', 'generale', 'michelin'),
//     'clean_name' => 'compagnie etablissements generale michelin',
//     'clean_name_no_space' => 'compagnieetablissementsgeneralemichelin',
//     'acronym' => 'cgem',
// );

cleaner's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.