2017 © Pedro Peláez
 

library wordstore

This is a CRUD compliant, language data storage class.

image

gavinggordon/wordstore

This is a CRUD compliant, language data storage class.

  • Thursday, December 29, 2016
  • by gavinggordon
  • Repository
  • 2 Watchers
  • 1 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

WordStore v2.0.6

Build Status, (*1)

Synopsis

This PHP class ( GGG\WordStore ) is a CRUD compliant language data storage class. It provides the ability to create a language dictionary. All enteries you create are stored in the WordStore and can contain user-definited parameters, all of which can be: searched and retrieved; updated; and, deleted., (*2)

How to use 'WordStore'

Install via Composer...

    composer require gavinggordon/wordstore

Include autoload.php...

    include_once( __DIR__ . '/vendor/autoload.php' );

Create new instance...

    //
    // new WordStore( 
    // 
    // @param string $dictionary_file *optional* 
    // default value = 'dictionary.json'
    //  
    // );
    //
    // @return object
    // 

    $json_dictionary_file = __DIR__ . '/myDictionary.json';
    // optionally, override the default name to be used for the .json
    // dictionary file, where all the related word data will be stored

    $wordstore = new GGG\WordStore( $json_dictionary_file );
    // creates the dictionary storage file, if it doesn't already exist

Adding a word...

    //
    // WordStore->add(
    //
    //  @param string $part_of_speech *required*
    // possible values =    
    // 'adjective' || 'adverb' || 'article' || 'interjection' ||
    // 'noun' || 'pronoun' || 'personalpronoun' || 
    // 'preposition' || 'punctuation' || 'verb'
    //
    //  @param string $word *required*
    //  possible values = *
    //
    //  @param array $params *required*
    //  possible values = *
    //
    // );
    //
    // @return object | FALSE
    //

    $wordstore->add( 'noun', 'vuča', [ 
        'translation' => 'friend',
        'pronounciation' => 'voo-cha' 
    ] );

Finding a word...

    //
    // WordStore->find(
    //
    //  @param string $value *required*
    //  possible values = *
    //
    //  @param string $part_of_speech *optional*
    // default value = NULL
    // possible values =    
    // 'adjective' || 'adverb' || 'article' || 'interjection' ||
    // 'noun' || 'pronoun' || 'personalpronoun' || 
    // 'preposition' || 'punctuation' || 'verb'
    //
    //  @param string $param *optional*
    // default value = NULL
    //  possible values = *
    //
    // );
    //
    // @return array | FALSE;
    //

    $word = $wordstore->find( 'vuča' );
    print_r( $word );

    //
    // Array
    // (
    //      [translation] => friend
    //      [pronounciation] => voo-cha
    // );
    //

Updating a word...

    //
    // WordStore->update(
    //
    //  @param string $newvalue *required*
    //  possible values = *
    //
    //  @param string $oldvalue *required*
    //  possible values = *
    //
    //  @param string $part_of_speech *optional*
    // default value = NULL
    // possible values = 
    // 'adjective' || 'adverb' || 'article' || 'interjection' ||
    // 'noun' || 'pronoun' || 'personalpronoun' || 
    // 'preposition' || 'punctuation' || 'verb'
    //
    //  @param string $param *optional*
    // default value = NULL
    //  possible values = *
    //
    // );
    //
    // @return object | FALSE
    //

    $wordstore->update( 'partner', 'vuča', 'noun', 'translation' );
    $word = $wordstore->find( 'buddy' );

    //
    // Array
    // (
    //    [0] => stdClass Object
    //         (
    //              [translation] => partner
    //              [pronounciation] => voo-cha
    //        )
    // );
    //

Deleting a word...

    //
    // WordStore->delete(
    //
    //  @param string $newvalue *required*
    //  possible values = *
    //
    //  @param string $part_of_speech *optional*
    // default value = NULL
    // possible values = 
    // 'adjective' || 'adverb' || 'article' || 'interjection' ||
    // 'noun' || 'pronoun' || 'personalpronoun' || 
    // 'preposition' || 'punctuation' || 'verb'
    //
    // );
    //
    // @return object | FALSE
    //

    $wordstore->delete( 'vuča', 'noun' );
    $word = $wordstore->find( 'vuča' );

    //
    // FALSE
    //

More Information

PHP Innovation Award

This class has been nominated for a PHP Innovation Award, provided by PHPClasses.org. If you found this class to be at all interesting, helpful, particularly useful, or innovative in any way, please vote for it, to show your support for this or any other PHP classes accessible online via my GitHub profile or PHPClasses.org profile., (*3)


The Versions

29/12 2016

dev-master

9999999-dev http://wordstore.gavingordon.com

This is a CRUD compliant, language data storage class.

  Sources   Download

MIT

The Development Requires

language php json crud storage custom dictionary words wordstore conlang custom dictionary language maker language creator dictionary builder create read update delete v2.0.6

09/08 2016

2.0.6

2.0.6.0 http://wordstore.gavingordon.com

This is a CRUD compliant, language data storage class.

  Sources   Download

MIT

The Development Requires

language php json crud storage custom dictionary words wordstore conlang custom dictionary language maker language creator dictionary builder create read update delete v2.0.6

25/05 2016

1.1.1

1.1.1.0 http://wordstore.gavingordon.com

A PHP class which allows one to create a language dictionary, by adding words and their translations, both of which can be searched for and retrieved after adding, in addition to custom parameters.

  Sources   Download

MIT

The Development Requires

language php json storage custom dictionary words wordstore conlang custom dictionary language maker language creator dictionary builder v1.1.1

25/05 2016

1.1

1.1.0.0 http://wordstore.gavingordon.com

A PHP class which allows one to create a language dictionary, by adding words and their translations, both of which can be searched for and retrieved after adding, in addition to custom parameters.

  Sources   Download

MIT

The Development Requires

language php json storage custom dictionary words v1.1 wordstore conlang custom dictionary language maker language creator dictionary builder

21/05 2016

1.0.1

1.0.1.0 http://wordstore.gavingordon.com

A PHP class which allows one to create a language dictionary, by adding words and their translations, both of which can be searched for and retrieved after adding, in addition to custom parameters.

  Sources   Download

MIT

The Development Requires

language php json storage custom dictionary words v1.0.1 wordstore conlang custom dictionary language maker language creator dictionary builder

14/04 2016

1.0.0

1.0.0.0 http://wordstore.gavingordon.com

A PHP class which allows one to create a language dictionary, by adding words and their translations, both of which can be searched for and retrieved after adding, in addition to custom parameters.

  Sources   Download

MIT

The Development Requires

language php json storage custom dictionary words v1.0.0 wordstore conlang custom dictionary language maker language creator dictionary builder