Sha256: 71e72bfd68ae3a18bf46273ab568e2a695edccbfe6167610502d233656a1e05f
Contents?: true
Size: 829 Bytes
Versions: 13
Compression:
Stored size: 829 Bytes
Contents
module Liquid module CustomFilters module Filters def values(list) list.values end def terminological_data(term) result = [] result << "<#{term['usage_info']}>" if term["usage_info"] result << extract_grammar_info(term) result << term["geographical_area"]&.upcase result.unshift(",") if result.compact.size.positive? result.compact.join(" ") end def extract_grammar_info(term) return unless term["grammar_info"] grammar_info = [] term["grammar_info"].each do |info| grammar_info << info["gender"]&.join(", ") grammar_info << info["number"]&.join(", ") grammar_info << extract_parts_of_speech(info) end grammar_info.join(" ") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems