SmartTruncate:smart_truncate 是一个简单的 Rails gem,可以像人类一样截断文本

时间:2021-06-03 16:24:27
【文件属性】:
文件名称:SmartTruncate:smart_truncate 是一个简单的 Rails gem,可以像人类一样截断文本
文件大小:11KB
文件格式:ZIP
更新时间:2021-06-03 16:24:27
Ruby 智能截断 smart_truncate 是一个简单的 Rails gem,可以像人类一样截断文本。 有没有想过截断一些文本直到 Ntn 字符才发现一个单词或句子被切成两半? SmartTruncate 解决了这个问题。” 安装 gem install smart_truncate BASIC smart_truncate USE # truncate by characters and it will end in a meaningful word SmartTruncate . by_chars ( "I am a nice sentance… Previous sentence is not with a proper multicolon ending." , 26 , '!' ) # => "I am a nice sentance… Previous!" # trunca
【文件预览】:
SmartTruncate-master
----smart_truncate-0.1.2.gem(7KB)
----Rakefile(581B)
----test()
--------smart_truncate_test.rb(4KB)
----LICENSE(1KB)
----Gemfile(570B)
----Gemfile.lock(493B)
----smart_truncate.gemspec(906B)
----.gitignore(139B)
----lib()
--------smart_truncate()
--------tasks()
--------smart_truncate.rb(985B)
----README.md(1KB)
----MIT-LICENSE(1KB)

网友评论