<commit_before>finger [![Build Status](https://travis-ci.org/fistlabs/finger.svg?branch=master)](https://travis-ci.org/fistlabs/finger)
=========

Finger is a powerful and fast nodejs router

##[core/rule](core/rule.js)
```Rule``` is a part of ```Matcher``` that can match and build urls described in special syntax.

###```Rule new Rule(String ruleString[, Object options])```
Creates new rule.

```js
var rule = new Rule('/');
```

####```String ruleString```
```ruleString``` is a ```String``` describing url both for matching and building.
It consists of static rule parts, parameters captures and optional parts.

```
/news/(42/)
```
The ```/news/``` part describes required part of url, and ```42/``` - optional.
Let's make optional part more dynamic:

```
/news/(<postId>/)
```
Now, ```postId``` is parameter now. This rule both valid for ```/news/``` and ```/news/146/``` urls.

####```Object options```
Rule object support some options

#####```Boolean options.ignoreCase```
Disables case sensitivity for pathname rule

```js
var rule = new Rule('/news/', {
    ignoreCase: true
});
```

For this rule both ```/news/``` and ```/NeWs/``` urls are identical.

###```Object|null rule.match(String url)```
Matches the url to the rule. Returns the set of values according to described arguments

```js
var rule = new Rule('/news/(<postId>/)');
rule.match('/news/'); // -> {postId: undefined}
rule.match('/news/146/?date=42'); // -> {postId: '146', date: '42'}
rule.match('/forum/'); // -> null
```

###```String rule.build([Object args])```
Builds url from rule

```js
var rule = new Rule('/news/(<postId>/)');
rule.build(); // -> '/news/'
rule.build({postId: 146}); // -> '/news/146/'
rule.build({date: 42}); // -> /news/?date=42
rule.build({postId: 146, date: 42}); // -> /news/146/?date=42
```
##[core/matcher](core/matcher.js)<commit_msg>Add readme notes aboud appendSlash<commit_after>finger [![Build Status](https://travis-ci.org/fistlabs/finger.svg?branch=master)](https://travis-ci.org/fistlabs/finger)
=========

Finger is a powerful and fast nodejs router

##[core/rule](core/rule.js)
```Rule``` is a part of ```Matcher``` that can match and build urls described in special syntax.

###```Rule new Rule(String ruleString[, Object options])```
Creates new rule.

```js
var rule = new Rule('/');
```

####```String ruleString```
```ruleString``` is a ```String``` describing url both for matching and building.
It consists of static rule parts, parameters captures and optional parts.

```
/news/(42/)
```
The ```/news/``` part describes required part of url, and ```42/``` - optional.
Let's make optional part more dynamic:

```
/news/(<postId>/)
```
Now, ```postId``` is parameter now. This rule both valid for ```/news/``` and ```/news/146/``` urls.

####```Object options```
Rule object support some options

#####```Boolean options.ignoreCase```
Disables case sensitivity for pathname rule

```js
var rule = new Rule('/news/', {
    ignoreCase: true
});
```

For this rule both ```/news/``` and ```/NeWs/``` urls are identical.

#####```Boolean options.appendSlash```
Allows url to do not contain trailing slash

```js
var rule = new Rule('/news/', {
    appendSlash: true
});
```

For this rule both ```/news/``` and ```/news``` urls are valid.

###```Object|null rule.match(String url)```
Matches the url to the rule. Returns the set of values according to described arguments

```js
var rule = new Rule('/news/(<postId>/)');
rule.match('/news/'); // -> {postId: undefined}
rule.match('/news/146/?date=42'); // -> {postId: '146', date: '42'}
rule.match('/forum/'); // -> null
```

###```String rule.build([Object args])```
Builds url from rule

```js
var rule = new Rule('/news/(<postId>/)');
rule.build(); // -> '/news/'
rule.build({postId: 146}); // -> '/news/146/'
rule.build({date: 42}); // -> /news/?date=42
rule.build({postId: 146, date: 42}); // -> /news/146/?date=42
```
##[core/matcher](core/matcher.js)
{'fraction_non_alphanumeric': 0.22894937674891885, 'fraction_numerical': 0.018824726532688883, 'mean_word_length': 4.356948228882834, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1106125', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1255, 'n_words': 410}