Skip to content

Commit 22fba0c

Browse files
authored
Merge pull request #6 from aymanrb/1.1.0-beta
1.1.0 beta
2 parents ed5f206 + b5a1dc5 commit 22fba0c

File tree

27 files changed

+1774
-394
lines changed

27 files changed

+1774
-394
lines changed

.gitignore

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
1+
# IDEA Ignores #
2+
################
3+
*.iml
4+
*.ipr
5+
*.iws
6+
.idea/
7+
out/
8+
local.properties
19

2-
Examples/Logs/*
10+
# Packages #
11+
############
12+
*.7z
13+
*.dmg
14+
*.gz
15+
*.iso
16+
*.rar
17+
*.tar
18+
*.zip
19+
vendor/
320

21+
# Logs and databases #
22+
######################
23+
log/
24+
*.log
25+
*.sql
26+
*.sqlite
27+
28+
# OS files #
29+
######################
30+
.DS_Store
31+
.DS_Store?
32+
ehthumbs.db
33+
Icon?
34+
Thumbs.db
35+
36+
# Project Specific #
37+
######################
38+
examples/Logs/*
39+
40+
# Git Directories #
41+
######################
442
!empty
43+
!.gitkeep

.travis.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
language: php
2+
23
php:
3-
- 5.5
4-
- 5.4
5-
6-
script: phpunit tests/TextParserTest.php
4+
- 5.6
5+
- 7.0
6+
- 7.1
7+
8+
matrix:
9+
fast_finish: true
10+
11+
before_script:
12+
- composer self-update
13+
- composer install --prefer-source --no-interaction --dev
14+
15+
script: phpunit tests
716

17+
notifications:
18+
on_success: never
19+
on_failure: always

Examples/Logs/parser.log

Whitespace-only changes.

Examples/run.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ About this Class
1111
This is a PHP Class to help extract text out of documents that are not structured in a processing friendly way. When you want to parse text out of form generated emails for example you can create a template matching the expected incoming mail format while specifying the variable text elements and leave the rest for the class to extract your preformatted variables out of the incoming mails' body text.
1212

1313
Useful when you want to parse data out of:
14-
* Web Pages / HTML documents
1514
* Emails generated from web forms
1615
* Documents with definable templates / expressions
1716

18-
1917
**Note:** When too many templates are added to the specified templates directory it slows the parsing process in a noticeable manner. This happens since the class runs over all the template files and compares it with the passed text to decide on the most suitable template for parsing.
2018

2119
Current Version
2220
----------
23-
1.0.2-beta
21+
1.1.0-beta
2422

2523

2624
Installation
@@ -40,22 +38,23 @@ $ git clone https://github.com/aymanrb/php-unstructured-text-parser.git
4038

4139

4240

43-
[Usage example](https://github.com/aymanrb/php-unstructured-text-parser/blob/master/Examples/run.php)
41+
[Usage example](https://github.com/aymanrb/php-unstructured-text-parser/blob/master/examples/run.php)
4442
----------
4543
```php
4644
<?php
47-
require_once('src/TextParserClass.php');
45+
include_once __DIR__ . '/../vendor/autoload.php';
46+
47+
use aymanrb\UnstructuredTextParser\TextParser;
4848

4949
try{
5050
$parser = new TextParser('/path/to/templatesDirectory');
5151

5252
$textToParse = 'Text to be parsed fetched from a file, mail, web service, or even added directly to the a string variable like this';
53-
echo "<pre>";
54-
print_r($parser->parseText($textToParse));
55-
echo "</pre>";
53+
54+
print_r($parser->parseText($textToParse));
5655

5756
}catch (Exception $e) {
58-
echo '<b>Error:</b> ' . $e->getMessage();
57+
echo 'Error' . $e->getMessage();
5958
}
6059
```
6160

composer.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"keywords": [
55
"text parser", "extract data", "php parser"
66
],
7+
"version": "1.1.0-beta",
78
"type": "library",
89
"license": "MIT",
910
"authors": [
@@ -19,10 +20,21 @@
1920
"issues": "https://github.com/aymanrb/php-unstructured-text-parser/issues",
2021
"source": "https://github.com/aymanrb/php-unstructured-text-parser"
2122
},
23+
"autoload": {
24+
"psr-4": {
25+
"aymanrb\\UnstructuredTextParser\\": "src/"
26+
}
27+
},
28+
"autoload-dev": {
29+
"psr-4": {
30+
"aymanrb\\UnstructuredTextParser\\Tests\\": "tests/"
31+
}
32+
},
2233
"require": {
23-
"php": ">=5.3.0"
34+
"php": ">=5.6.0",
35+
"monolog/monolog": "^1.23"
2436
},
2537
"require-dev": {
26-
"phpunit/phpunit": "4.2.*"
38+
"phpunit/phpunit": "^5.0"
2739
}
2840
}

0 commit comments

Comments
 (0)