Module: BELParser::Script::Keyword

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

Instance Method Details

#is_bel_version?(string) ⇒ Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


23
24
25
# File 'lib/bel_parser/script/keywords.rb', line 23

def is_support?(string)
  string =~ SUPPORT_REGEX
end