ruby-eo:Ruby 编程语言的世界语分析器

  • H5_324775
    了解作者
  • 2.4KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-24 18:53
    上传日期
#ruby-eo ruby-eo 是 Ruby 编程语言的世界语单词分析器。 这个怎么运作? ruby-eo.rb包含一个名为“Esperanto”的类,它继承自 Ruby 的“String”类。 所以,他们有很多相互的方法,比如“反向”或“长度”。 如何在我们的代码中调用它? 只需制作一些 ruby​​ 源文件,例如esperanto.rb ,将ruby-eo.rb复制到目录中并添加以下行: load 'ruby-eo.rb' 或者,如果你不喜欢它,你可以使用ruby-eo-mod.rb ,“世界语”类是作为一个模块编写的,这使得使用和编写代码更容易。 你可以这样称呼它: load 'ruby-eo-mod.rb' 差异 在ruby-eo.rb ,它需要创建一个新的世界语类型变量,如下所示: a = Esperanto . new ( "Amiko" ) 或者,
ruby-eo-master.zip
  • ruby-eo-master
  • ruby-eo.rb
    1.9KB
  • ruby-eo-mod.rb
    1.8KB
  • README.md
    3.4KB
内容介绍
#ruby-eo ruby-eo is an Esperanto word analyzer for Ruby programming language. ## How it works? ```ruby-eo.rb ``` includes a class called "Esperanto", which inherited from "String" class of Ruby. So, they have a lot of mutual methods like "reverse" or "length". ### How to call it in our code? Just make some ruby source file(s), like ```esperanto.rb``` , copy ```ruby-eo.rb``` in the directory and add this line to it: ```ruby load 'ruby-eo.rb' ``` Or if you don't like it, you can use ```ruby-eo-mod.rb``` , the "Esperanto" class is written as a module in that one, and that makes using and writing code easier. You can call it just like this : ```ruby load 'ruby-eo-mod.rb' ``` #### Differences In ``` ruby-eo.rb ```, it needs to make a new Esperanto type variable like this : ```ruby a = Esperanto.new("Amiko") ``` or, converting a String type value to Esperanto : ```ruby a = "Amiko".to_eo ``` ### Methods Here are list of ```ruby-eo``` 's methods. * is_noun? it detects that entry is a noun or not. ```ruby word.is_noun? ``` returns ```true``` and ``` false ```. Depending on the word. * is_adj? it detects that entry is an adjective or not. ```ruby word.is_adj? ``` returns ```true``` and ``` false ```. Depending on the word. * is_adv? it detects that entry is an adverb or not. ```ruby word.is_adv? ``` returns ```true``` and ``` false ```. Depending on the word. * is_opposite? it detects that entry is opposite or not. ```ruby word.is_opposite? ``` returns ```true``` and ``` false ```. Depending on the word. * is_verb? it detects that entry is verb or not. ```ruby word.is_verb? ``` returns ```true``` and ``` false ```. Depending on the word. #### Verb times and forms * is_present? it detects that entry is present or not. ```ruby word.is_present? ``` returns ```true``` and ``` false ```. Depending on the word. * is_past? it detects that entry is past or not. ```ruby word.is_past? ``` returns ```true``` and ``` false ```. Depending on the word. * is_future? it detects that entry is future or not. ```ruby word.is_future? ``` returns ```true``` and ``` false ```. Depending on the word. * is_conditional? it detects that entry is conditional or not. ```ruby word.is_conditional? ``` returns ```true``` and ``` false ```. Depending on the word. * is_imp? it detects that entry is imperative or not. ```ruby word.is_imp? ``` returns ```true``` and ``` false ```. Depending on the word. * is_inf? it detects that entry is infinitive or not. ```ruby word.is_inf? ``` returns ```true``` and ``` false ```. Depending on the word. * is_negative? it detects that entry is negative or not. ```ruby word.is_negative? ``` returns ```true``` and ``` false ```. Depending on the word. #### Continue : * is_female? it detects that entry is female or not. ```ruby word.is_female? ``` returns ```true``` and ``` false ```. Depending on the word. * make_female makes entry female. ```ruby word.make_female ``` * make_opposite makes entry opposite. ```ruby word.make_opposite ``` #### Special methods PAY ATTENTION : THESE TWO METHODS ARE ONLY FOR ``` ruby-eo.rb ``` FILE. * to_eo makes a ```String``` class ```Esperanto``` ```ruby word = "Amiko" word = word.to_eo word.class #returns "Esperanto" ``` * to_s makes an ```Esperanto``` class ```String```. ```ruby word = Esperanto.new("Amikino") word = word.to_s word.class #returns "String" ```
评论
    相关推荐
    • Ruby-Savon是一个Ruby编程语言的SOAP客户端
      Savon是一个Ruby编程语言的SOAP客户端
    • persian-bechasboon:用于 Ruby 编程语言的工具,用于将通用断开的波斯字母替换为其连接的对应字母
      许多编程库都不能很好地支持具有连接字符的语言。 波斯语就是其中之一。 我尝试使用 prawn 作为 PDF 生成器来创建 pdf 格式的报告。 但由于上述问题,它失败了。 所以我找到了 arabic-letter-connector,它解决了...
    • ruby_videos:关于 Ruby 编程语言或与之相关的优质视频的精选列表
      关于 Ruby 编程语言或与 Ruby 编程语言相关的优质视频的精选列表。 这将有助于推广演讲者、活动和赞助商,并将帮助 Ruby 程序员。 我一直在保留一份我看过的高质量视频的列表,并认为将其放到网上并允许其他人观看...
    • ruby_bench:ruby 编程语言的基准
      ruby_bench 只是一个长凳
    • ruby-kickstart:学习Ruby编程语言的交互式指南
      RubyKickstart是学习Ruby编程语言的交互式指南。 此处的材料与一起跟随,但不必观看它们即可获得好处。 并获得带有注释和挑战的。 这个怎么运作 RubyKickstart作为一个充满文件和文件夹的文件夹下载到您的计算机上...
    • rubychanges:Ruby编程语言的全面变更日志
      基本上,每个Ruby版本的文件所包含的信息都是相同的,只是更具可读性和信息性。 最新版本: ( - - - ) 主要目标: Full :与大多数“ Ruby xy的新功能?”不同博客文章,此处的信息旨在覆盖当前Ruby版本的所有...
    • Ruby编程语言(The Ruby Programming Language)
      本书详细介绍了Ruby1.8和1.9...在对Ruby进行了简要的综述之后,本书详细介绍了以下内容:Ruby的句法和语法结构,数据结构和对象,表达式和操作符,语句和控制结构,方法、proc、lambda和闭包,反射和园变成,Ruby平台。
    • Ruby编程语言
      Ruby编程语言》详细介绍了Ruby1.8和1.9版本各方面的内容。在对Ruby进行了简要的综述之后,《Ruby编程语言》详细介绍了以下内容:Ruby的句法和语法结构,数据结构和对象,表达式和操作符,语句和控制结构,方法、...
    • ruby-ftw:Ruby编程语言的演示
      Ruby编程语言的偏见。 Ruby易于阅读,理解和学习。 它的历史可以追溯到1995年,已经过时了,最近已发布到3.0版。 演讲提供了基本的介绍,讨论了语言的目标并显示了一些不错的示例。 用法 幻灯片(PDF)使用生成。 ...
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档