Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with count #2

Open
hooman-mirghasemi opened this issue Jun 6, 2017 · 2 comments
Open

problem with count #2

hooman-mirghasemi opened this issue Jun 6, 2017 · 2 comments

Comments

@hooman-mirghasemi
Copy link

it can not count string like :
"سلام this is سلام"
and only count english word when string have tow language charset.
it is better to change getLengh method like:
public function getLength()
{
if (null === $this->_length) {
$this->_length = preg_match_all('/\pL+/u',$this->getSource());
}
return $this->_length;
}

@thyseus
Copy link
Owner

thyseus commented Jun 6, 2017

Hey,

this is a nice catch. Can you explain to me how this regular expression works?

@hooman-mirghasemi
Copy link
Author

Test it.
it count words currectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants