sbagdat / turkish_support Goto Github PK
View Code? Open in Web Editor NEWTurkish character support for core ruby methods.
License: MIT License
Turkish character support for core ruby methods.
License: MIT License
Selam,
Mesela row.map {|elem| elem.capitalize}
yerine row.map(&:capitalize)
yazinca Turkce destegi calismiyor. Ornek:
row = ["NEVŞEHİR", "ACIGÖL", "MERKEZKÖYLER", "1 KÜME MAH (AĞILLI KÖYÜ)", "50142"]
row.map {|elem| elem.capitalize} => ["Nevşehir", "Acıgöl", "Merkezköyler", "1 küme mah (ağıllı köyü)", "50142"]
row.map(&:capitalize) => ["NevŞehİr", "AcigÖl", "MerkezkÖyler", "1 kÜme mah (aĞilli kÖyÜ)", "50142"]
Sanirim ikincisinde Proc
objesi yarattigi icin oluyor
önce hata çıktısı
.rvm/gems/ruby-2.3.3@rails5_1_1/gems/turkish_support-1.0.3/lib/turkish_support/array_methods.rb:4:in
sort_by': comparison of Array with Array failed (ArgumentError)`
.rvm/gems/ruby-2.3.3@rails5_1_1/gems/turkish_support-1.0.3/lib/turkish_support/array_methods.rb:4:in
sort'
from ./sort.rb:13:in <main>'
bu hatayı içinde türkçe karakter olmayan dizinlerde de alıyorum
# şu sorunsuz çalışıyor
['isim soyisim', 'isim soyisim'].sort
# şu ise çalışmıyor
['isim soyisim', 'isim1 soyisim'].sort
# aynı şekilde bu da çalışmıyor
['isim1 soyisim', 'isim soyisim'].sort
sorun sadece boşluk olmasında da değil
# bu çalışıyor
['isim1soyisim', 'isim2soyisim'].sort
# bunlar ise çalışmıyor
['isim1soyisim', 'isim21soyisim'].sort
['1soyisim', '12soyisim'].sort
['a', '3s'].sort
['1a', 'b'].sort
['a', '2 b'].sort
# her kelimeden sonra birer boşluk var
['a ' , 'ab '].sort
Hey,
There is a problem with "i" character when upcasing it.
str = "içel"
str.upcase
str #=> "IÇEL"
It should be "İÇEL".
Sayfanın başına # frozen_string_literal: true
magic comment ekledikten sonra upcase ve downcase string fonksiyonlarında can't define singleton gibi bir hata alıyorum.
Linux Yaz Kampında sınıf olarak Ruby 2.2.2 pry'da çalıştıramadık.
'LOREM ( IPSUM)'.titleize
/Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/helpers.rb:28:in `prepare_for': Invalid arguments for method `prepare_for`! (ArgumentError)
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/helpers.rb:67:in `prepare_for_capitalize'
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/helpers.rb:31:in `call'
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/helpers.rb:31:in `prepare_for'
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/string_methods.rb:19:in `block (3 levels) in <module:TurkishSupport>'
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/string_methods.rb:30:in `block in titleize'
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/string_methods.rb:25:in `map'
from /Users/halil/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/turkish_support-1.0.0/lib/turkish_support/string_methods.rb:25:in `titleize'
from test.rb:9:in `hey'
from test.rb:13:in `<main>'
'( '.titleize # => <The same error>
'('.titleize # => <The same error>
'LOREM (IPSUM)'.titleize # => Lorem (Ipsum)
I am trying to comparison strings with usign Ruby upcase method. For example;
banks.select { |b| b["banka"]["bAd"] == bank_name.upcase }
Here when I try to run rspec tests I faced SystemStackError: stack level too deep
error. It occurs on
../ruby-2.6.2/gems/turkish_support-1.1.3/lib/turkish_support/string_methods.rb:18
Could you help me?
Cheers.
String comparison methods like >
, '>=', ... must be implemented.
Hi i'm trying to use sort method with <=> operator
.sort { |a,b| a[0] <=> b[0] }
but didn't work
Array sort block ile kullanımı hatalı
Add usage in irb to README for testing functionality of the gem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.