From 8424d703eca484d5e7e5e99db160fdebf0bd4728 Mon Sep 17 00:00:00 2001 From: Patrick Schur Date: Mon, 20 Feb 2017 02:24:29 +0100 Subject: [PATCH] Fixed wrong formatted README.md --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c57c7ae..a9a968e 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Array ## API -### `__construct(array $result = [])` +#### `__construct(array $result = [])` You can pass an array of languages to the constructor. To compare the desired sentence only with the given languages. This can dramatically increase the performance. ```php @@ -67,7 +67,7 @@ $ld->detect('Das ist ein Test'); ```
-### `whitelist(string ...$whitelist)` +#### `whitelist(string ...$whitelist)` Provide a whitelist. Returns a list of languages, which are required. ```php $ld->detect('Mag het een onsje meer zijn?')->whitelist('de', 'nn', 'nl', 'af')->close(); @@ -84,7 +84,7 @@ Array ```
-### `blacklist(string ...$blacklist)` +#### `blacklist(string ...$blacklist)` Provide a blacklist. Removes the given languages from the result. ```php $ld->detect('Mag het een onsje meer zijn?')->blacklist('dk', 'nb', 'de')->close(); @@ -105,7 +105,7 @@ Array ```
-### `bestResults()` +#### `bestResults()` Returns the best results. ```php $ld->detect('Mag het een onsje meer zijn?')->bestResults()->close(); @@ -119,7 +119,7 @@ Array ```
-### `limit(int $offset, int $length = null)` +#### `limit(int $offset, int $length = null)` You can specify the number of records to return. For example the following code will return the top three entries. ```php $ld->detect('Mag het een onsje meer zijn?')->limit(0, 3)->close(); @@ -135,7 +135,7 @@ Array ```
-### `close()` +#### `close()` Returns the result as an array. ```php $ld->detect('This is an example!')->close(); @@ -154,7 +154,7 @@ Array ```
-### `setTokenizer(TokenizerInterface $tokenizer)` +#### `setTokenizer(TokenizerInterface $tokenizer)` The script use a tokenizer for getting all words in a sentence. You can define your own tokenizer to deal with numbers for example. ```php @@ -169,7 +169,7 @@ $ld->setTokenizer(new class implements TokenizerInterface This will return only characters from the alphabet in lowercase and numbers between 0 and 9.
-### `__toString()` +#### `__toString()` Returns the top entrie of the result. Note the `echo` at the beginning. ```php echo $ld->detect('Das ist ein Test.'); @@ -180,7 +180,7 @@ de ```
-### `jsonSerialize()` +#### `jsonSerialize()` Serialized the data to JSON. ```php $object = $ld->detect('Tere tulemast tagasi! Nägemist!'); @@ -200,7 +200,7 @@ Result: ```
-#### Method chaining +## Method chaining You can also combine methods with each other. The following example will remove all entries specified in the blacklist and returns only the top four entries. ```php @@ -218,7 +218,7 @@ Array ```
-#### ArrayAccess +## ArrayAccess You can also access the object directly as an array. ```php $object = $ld->detect(Das ist ein Test'); @@ -367,4 +367,4 @@ The detection phase is only affected when you are trying to detect big chunks of Feel free to contribute. Any help is welcome. ## License -This projects is licensed under the terms of the MIT license. \ No newline at end of file +This projects is licensed under the terms of the MIT license.