Skip to content

Commit

Permalink
Merge pull request #3 from mshka/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
mshka authored Dec 21, 2017
2 parents bd0b695 + 2149147 commit 0b615f2
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ FarsiNormalizer is a replacement for the Lucene [persian_normalizer](http://luce
Instead of normalizing farsi\persian characters to arabic this gem normalize the arabic characters to farsi\persian

Normalization is defined as:
- Normalization of arabic keh to farsi keheh
- Normalization of arabic yeh and arabic alef maksoura to farsi yeh
- Normalization of [arabic kaf](https://unicode-table.com/en/0643/) to [farsi keheh](https://unicode-table.com/en/06A9/)
- Normalization of [arabic yeh](https://unicode-table.com/en/064A/) and [arabic alef maksoura](https://unicode-table.com/en/0649/) to [farsi yeh](https://unicode-table.com/en/06CC/)

## Installation

Expand All @@ -30,29 +30,25 @@ Or install it yourself as:
require 'farsi_normalizer'


[1] pry(main)> FarsiNormalizer.normalize("بسکويت")
=> "بسکويت"
[1] pry(main)> FarsiNormalizer.normalize("ك")
=> "ک"

[2] pry(main)> FarsiNormalizer.new("بسکويت").normalize
=> "بسکويت"
[2] pry(main)> FarsiNormalizer.new("ي").normalize
=> "ی"

[3] pry(main)> FarsiNormalizer.normalize("بسكويت", only: ["ك"])
=> "بسکويت"
[3] pry(main)> FarsiNormalizer.normalize("ك ي", only: ["ك"])
=> "ک ي"

[4] pry(main)> FarsiNormalizer.normalize("بسكويت", except: ["ك"])
=> "بسكویت"
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
[4] pry(main)> FarsiNormalizer.normalize("ك ي", only: ["ك"])
=> "ك ی"

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing
[5] pry(main)> FarsiNormalizer.normalize("بسکوىت")
=> "بسکویت"
```

Bug reports and pull requests are welcome on GitHub at https://github.com/mshka/farsi_normalizer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
### Questions or Problems?

If you have any issues with farsi_normalizer which you cannot find the solution, please add an [issue on GitHub][https://github.com/mshka/farsi_normalizer/issues] or fork the project and send a pull request.

## License

Expand Down

0 comments on commit 0b615f2

Please sign in to comment.