https://github.com/chief/greek_string_utils
Simple library to correct upcase in greek
https://github.com/chief/greek_string_utils
Last synced: about 1 year ago
JSON representation
Simple library to correct upcase in greek
- Host: GitHub
- URL: https://github.com/chief/greek_string_utils
- Owner: chief
- Created: 2012-01-05T23:30:36.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2014-01-01T20:15:29.000Z (over 12 years ago)
- Last Synced: 2024-10-31T14:23:20.660Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 124 KB
- Stars: 12
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GreekStringUtils
## Note
This project is a subset of a larger private repo. I hope that it will become
public soon.
## Description
This module simply provides some methods to handle issues with greek letters
1. upperfix: In general greek strings dont preserve accents when upcase.
2. remove_accents: Simply removes all accents
3. greek_sort: Simply sorts correctly greek letters
For other cases (capitalize, downcase etc) +unicode+, +mb_chars+ etc are doing
their job very well.
## Install
```ruby
gem install 'greek_string_utils'
```
## Usage
```ruby
require 'greek_string_utils'
include GreekStringUtils
a = 'το 2012 η ελλάδα θα είναι δεύτερη σε ύφεση στον κόσμο'
upperfix(a) # => 'ΤΟ 2012 Η ΕΛΛΑΔΑ ΘΑ ΕΙΝΑΙ ΔΕΥΤΕΡΗ ΣΕ ΥΦΕΣΗ ΣΤΟΝ ΚΟΣΜΟ'
a = %w(αβ άβ άα αα)
greek_sort(a) # => %w(άα αα άβ αβ)
a = 'κρύο'
remove_accents(a) # => 'κρυο'
```
if you want to use it in a rails app:
```ruby
gem 'greek_string_utils'
```
And normally in application_helper.rb:
```ruby
include GreekStringUtils
```
## Credits
Eric Cohen https://github.com/eirc
## License
greek_string_utils is released under the [MIT License](http://opensource.org/licenses/MIT)