Skip to content

Commit 91453b0

Browse files
committed
add interactive helper menu
1 parent 2ca6c38 commit 91453b0

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"psr-4": {
1414
"TextAnalysis\\": "src/"
1515
},
16-
"files": ["src/helpers/storage.php", "src/helpers/print.php", "src/helpers/simplified.php", "src/helpers/helpers.php"]
16+
"files": ["src/helpers/storage.php", "src/helpers/print.php", "src/helpers/simplified.php", "src/helpers/helpers.php", "src/helpers/interactive_help.php"]
1717
},
1818
"autoload-dev": {
1919
"files": ["tests/TestBaseCase.php"]

interactive

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/usr/bin/bash
1+
#!/bin/bash
22
# run the library in an interactive mode for doing analysis
3+
echo "Welcome to the PHP Text Analysis Interactive Console"
4+
echo "Type help(); to get a list of available functions"
35
php -a -d auto_prepend_file=./vendor/autoload.php
46

src/helpers/interactive_help.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
/**
4+
* List out a help menu in the interactive console
5+
*/
6+
function help()
7+
{
8+
$menu = [
9+
'text(string $text) -> Return a TextCorpus object',
10+
'normalize(string $text) -> Normalize text to lower case',
11+
'todo ....'
12+
];
13+
print_array($menu);
14+
}
15+

0 commit comments

Comments
 (0)