forked from synox/disposable-mailbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simpler version without much js, just vanilla pure simple php (with s…
…ome libs)
- Loading branch information
Showing
47 changed files
with
1,915 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea | ||
*.patch | ||
*.patch | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"require": { | ||
"php-imap/php-imap": "~2.0" | ||
}, | ||
"config": { | ||
"vendor-dir": "src/backend-libs" | ||
} | ||
"require": { | ||
"php-imap/php-imap": "~2.0", | ||
"gnugat/PronounceableWord": "*" | ||
}, | ||
"config": { | ||
"vendor-dir": "src/backend-libs" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,49 @@ | |
"mail", | ||
"php" | ||
] | ||
}, | ||
{ | ||
"name": "gnugat/PronounceableWord", | ||
"version": "2.0.0", | ||
"version_normalized": "2.0.0.0", | ||
"source": { | ||
"type": "git", | ||
"url": "[email protected]:gnugat/PronounceableWord.git", | ||
"reference": "60a19dc7148e92de35ea536b9f873b86365d48f0" | ||
}, | ||
"dist": { | ||
"type": "zip", | ||
"url": "https://api.github.com/repos/gnugat/PronounceableWord/zipball/60a19dc7148e92de35ea536b9f873b86365d48f0", | ||
"reference": "60a19dc7148e92de35ea536b9f873b86365d48f0", | ||
"shasum": "" | ||
}, | ||
"require": { | ||
"php": ">=5.2" | ||
}, | ||
"time": "2012-01-08 19:36:58", | ||
"type": "library", | ||
"installation-source": "dist", | ||
"autoload": { | ||
"psr-0": { | ||
"PronounceableWord_": "src/" | ||
} | ||
}, | ||
"notification-url": "https://packagist.org/downloads/", | ||
"license": [ | ||
"MIT" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Loïc Chardonnet" | ||
} | ||
], | ||
"description": "A light, customizable and simple library generating random and pronounceable words without using dictionaries or Markov chains.", | ||
"homepage": "https://github.com/gnugat/PronounceableWord", | ||
"keywords": [ | ||
"generator", | ||
"pronounceable", | ||
"word" | ||
], | ||
"abandoned": true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/nbproject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Change log | ||
========== | ||
|
||
This file will provide the main changes between each new versions. | ||
|
||
To get the diff for a specific change, go to https://github.com/gnugat/PronounceableWord/commit/XXX | ||
where XXX is the change hash. | ||
|
||
To get the diff between two versions, go to https://github.com/gnugat/PronounceableWord/compare/X.Y.Z...A.B.C | ||
where X.Y.Z and A.B.C are the tag names. | ||
|
||
2.0.0 (2012-01-08) | ||
------------------ | ||
|
||
* b9b3583: compatibility woth composer; | ||
* 01a495a: using lower probability for LinkedLetters configuration; | ||
* 8b27028: using a dependency injection container; | ||
* 24bd26c: using dependency injection pattern; | ||
* fe00216: complying to PSR-0 standard; | ||
* c6c7ea1: importing documentation from wiki. | ||
|
||
1.0.2 (2012-01-03) | ||
------------------ | ||
|
||
* 1e34020: updating the version number. | ||
|
||
1.0.1 (2012-01-03) | ||
------------------ | ||
|
||
* 3af0bff: copyright extended to 2012. | ||
|
||
1.0.0 (2011-12-17) | ||
------------------ | ||
|
||
* a86dcea: Initial stable release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
LICENSE | ||
======= | ||
|
||
License for the PronounceableWord PHP library | ||
|
||
The MIT license | ||
--------------- | ||
|
||
Copyright (c) 2011-2012 Loic Chardonnet | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
PronounceableWord PHP library | ||
============================= | ||
|
||
A light, customizable and simple PHP (>= 5.2) library, used to generate | ||
randomly pronounceable words, names and passwords without using database of | ||
existing words or big samples of text like with Markov chains. | ||
|
||
**Warning** | ||
|
||
Offensive or insulting words might be generated because of the random nature | ||
of the generator (see how to manage them in | ||
``./doc/manageOffensiveAndInsultingWords.rst``). | ||
|
||
Installation and usage | ||
====================== | ||
|
||
First, get the last stable version, and put it in an accessible directory. | ||
|
||
You can use composer to do so (http://packagist.org/), by adding in the | ||
``require`` of your file ``./composer.json`` the following entry: | ||
``"gnugat/PronounceableWord": "*"``. | ||
|
||
You should have a fully operationnal pronounceable word generator:: | ||
|
||
<?php | ||
// File "/index.php". | ||
require_once dirname(__FILE__) . '/vendor/PronounceableWord/src/PronounceableWord/DependencyInjectionContainer.php'; | ||
|
||
define('MINIMUM_LENGTH', 5); | ||
define('MAXIMUM_LENGTH', 11); | ||
|
||
$length = rand(MINIMUM_LENGTH, MAXIMUM_LENGTH); | ||
|
||
$container = new PronounceableWord_DependencyInjectionContainer(); | ||
$generator = $container->getGenerator(); | ||
$word = $generator->generateWordOfGivenLength($length); | ||
|
||
Configuration | ||
------------- | ||
|
||
To customize the algorithm, the letters used, the linked letters or the types, | ||
just copy and modify as you wish the files in the | ||
``./src/PronounceableWord/Configuration`` directory and then pass your | ||
configuration classes to the container (see how to configure in | ||
``./doc/configuration.rst``). | ||
|
||
Tests | ||
----- | ||
|
||
Tests are done using PHPUnit (https://github.com/sebastianbergmann/phpunit/) | ||
(>=3.5) in the ``./test`` directory (see how to test in ``./doc/tests.rst``). | ||
|
||
Examples | ||
-------- | ||
|
||
Here is a sample of examples that can be generated (use the | ||
``./bin/generateExamples.php`` script for more): | ||
|
||
======= ====== ======= ======== ========= | ||
Length 5 6 7 8 | ||
======= ====== ======= ======== ========= | ||
1 vicas panori eropops absugrit | ||
2 ramsa verifu simbous nimpiowi | ||
3 kiclu impriar rubleru entumecu | ||
4 posup bivary kitocra vemolior | ||
5 utler rugisi kanomev pactabie | ||
======= ====== ======= ======== ========= | ||
|
||
Algorithm | ||
========= | ||
|
||
Basically, the library will generate a word following these rules: | ||
|
||
1. Choose randomly a letter; | ||
2. choose randomly a linked letter of different type; | ||
3. choose randomly a linked letter, of different type if the last letter is | ||
of consecutive types. | ||
|
||
Where: | ||
|
||
* "linked letter" is an arbitrary chosen letter that is expected to follow | ||
well the previous letter; | ||
* "types" would be voyels and consonants; | ||
* "consecutive" would be a group of two letters from the same "type". | ||
|
||
The step 3 is repeated as many times as necessary. | ||
|
||
Documentation | ||
============= | ||
|
||
You can find more documentation at the following links: | ||
|
||
* Copyright and MIT license: ``./LICENSE.rst``; | ||
* version and change log: ``./VERSION.rst`` and ``CHANGELOG.rst``; | ||
* technical and usage documentation: ``./doc/``. | ||
|
||
Contributing | ||
============ | ||
|
||
1. Fork it: https://github.com/gnugat/PronounceableWord/fork_select ; | ||
2. create a branch (``git checkout -b my_branch``); | ||
3. commit your changes (``git commit -am "Changes description message"``); | ||
4. push to the branch (``git push origin my_branch``); | ||
5. create an Issue (https://github.com/gnugat/PronounceableWord/issues) with a | ||
link to your branch; | ||
6. wait for it to be accepted/argued. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
VERSION | ||
======= | ||
|
||
The purpose of this file is to point out the version of the PronounceableWord | ||
library. | ||
|
||
Current version | ||
--------------- | ||
|
||
2.0.0 |
26 changes: 26 additions & 0 deletions
26
src/backend-libs/gnugat/PronounceableWord/bin/generateExamples.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env php | ||
|
||
<?php | ||
/* | ||
* This file is part of the PronounceableWord library. | ||
* | ||
* (c) Loic Chardonnet | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
require_once dirname(__FILE__) . '/../src/PronounceableWord/DependencyInjectionContainer.php'; | ||
|
||
define('MINIMUM_LENGTH', 4); | ||
define('MAXIMUM_LENGTH', 9); | ||
|
||
$container = new PronounceableWord_DependencyInjectionContainer(); | ||
$generator = $container->getGenerator(); | ||
|
||
$maximumGenerationNumber = 20; | ||
for ($generationNumber = 0; $generationNumber < $maximumGenerationNumber; $generationNumber++) { | ||
$length = rand(MINIMUM_LENGTH, MAXIMUM_LENGTH); | ||
|
||
echo $generator->generateWordOfGivenLength($length) . "\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "gnugat/PronounceableWord", | ||
"type": "library", | ||
"description": "A light, customizable and simple library generating random and pronounceable words without using dictionaries or Markov chains.", | ||
"keywords": ["generator", "pronounceable", "word"], | ||
"homepage": "https://github.com/gnugat/PronounceableWord", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Loic Chardonnet" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.2" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"PronounceableWord_": "src/" | ||
} | ||
} | ||
} |
Oops, something went wrong.