Sha256: 5289f0dcad6ba8d0eca27484da6472ca3e6c795bf881f6d7a9812cd8bd02083e

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

module Zenlish
  module Lex
    # TODO: document
    class LexicalEntry
      #@return [String] the lemma (dictionary) form of a word.
      attr_reader :lemma

      # @return [Array<Lexeme, Rley::Syntax::Terminal>]
      attr_reader :lexemes

      # @param theLemma [String] lemma (= citation form), a word form used 
      #   conventionnaly to represent a lexeme.
      # @param aLexeme [Lexeme, NilClass] the lexeme to link with lexical entry.
      def initialize(theLemma, aLexeme = nil)
        @lemma = theLemma.dup
        @lexemes = []
        add_lexeme(aLexeme)
      end

      # @param aLexeme [Lexeme, NilClass] the lexeme to link with lexical entry.      
      def add_lexeme(aLexeme)
        lexemes << aLexeme if aLexeme
      end
    end # class
  end # module
end # module

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zenlish-0.2.05 lib/zenlish/lex/lexical_entry.rb
zenlish-0.2.04 lib/zenlish/lex/lexical_entry.rb
zenlish-0.2.03 lib/zenlish/lex/lexical_entry.rb
zenlish-0.2.02 lib/zenlish/lex/lexical_entry.rb