protected static function filterLists($lists, $policy)
    {
        $res = array();
        foreach ($lists as $name => $path) {
            if ((bool) preg_match($policy, $name)) {
                $res[$name] = $path;
            }
        }
        return $res;
    }
protected static function filterLists($lists, $policy)
    {
        $res = array();
        foreach ($lists as $name => $path) {
            if ((bool) preg_match($policy, $name)) {
                $res[$name] = $path;
            }
        }
        return $res;
    }
protected static function filterLists ( $ lists , $ policy ) { $ res = array ( ) ; foreach ( $ lists as $ name => $ path ) { if ( ( bool ) preg_match ( $ policy , $ name ) ) { $ res [ $ name ] = $ path ; } } return $ res ; }
Given a mapping of wordlists' names with their path
and a policy, returns the same mapping with only
those entries whose name matches the policy.

\param array $lists
A mapping of wordlists (indexed by their names)
to their path.

\param string $policy
A policy (as a regular expression pattern).

\retval array
A mapping of wordlists (indexed by their names)
to their path, contaning only those wordlists
that were allowed by the given policy.
Given a mapping of wordlists names with their path and a policy returns the same mapping with only those entries whose name matches the policy .