Module: BELParser::Script::Keyword
- Included in:
- State::BELVersion, State::Set, State::Unset, Syntax::UndefinedAnnotation, Syntax::UndefinedAnnotationValue, Syntax::UnsupportedBELVersion
- Defined in:
- lib/bel_parser/script/keywords.rb
Constant Summary collapse
- BEL_VERSION_STRING =
'BELVersion'.freeze
- BEL_VERSION_REGEX =
/\A#{BEL_VERSION_STRING}\Z/i
- CITATION =
'Citation'.freeze
- CITATION_REGEX =
/\A#{CITATION}\Z/i
- SUPPORT =
'Support'.freeze
- SUPPORT_REGEX =
/\A#{SUPPORT}\Z/i
- IMPLICIT_ANNOTATIONS =
['Citation', 'Support', 'STATEMENT_GROUP']
Instance Method Summary collapse
- #is_bel_version?(string) ⇒ Boolean
- #is_citation?(string) ⇒ Boolean
- #is_implicit_annotation?(string) ⇒ Boolean
- #is_support?(string) ⇒ Boolean
Instance Method Details
#is_bel_version?(string) ⇒ Boolean
15 16 17 |
# File 'lib/bel_parser/script/keywords.rb', line 15 def is_bel_version?(string) string =~ BEL_VERSION_REGEX end |
#is_citation?(string) ⇒ Boolean
19 20 21 |
# File 'lib/bel_parser/script/keywords.rb', line 19 def is_citation?(string) string =~ CITATION_REGEX end |
#is_implicit_annotation?(string) ⇒ Boolean
27 28 29 |
# File 'lib/bel_parser/script/keywords.rb', line 27 def is_implicit_annotation?(string) IMPLICIT_ANNOTATIONS.any? { |annotation| string == annotation } end |
#is_support?(string) ⇒ Boolean
23 24 25 |
# File 'lib/bel_parser/script/keywords.rb', line 23 def is_support?(string) string =~ SUPPORT_REGEX end |