class TXTextControl::ReportingCloud::IncorrectWord
Represents an incorrect word in spell checked text. @attr_reader [Integer] length The length of the spelled word. @attr_reader [Integer] start The starting position of a spelled word. @attr_reader [String] text The text of the spelled word. @attr_reader [Boolean] is_duplicate
Indicating whether the spelled word is
declared as incorrect, because the previous word has the same text.
@attr_reader [String] language Indicating the language the incorrect word
was spelled.
@author Thorsten Kummerow (@thomerow)
Attributes
Public Class Methods
Creates an IncorrectWord
instance from a hash. @param [Hash] hash The hash to try and create an IncorrectWord
instance from. @return [IncorrectWord] A newly created IncorrectWord
instance.
# File lib/txtextcontrol/reportingcloud/incorrect_word.rb, line 53 def self.from_camelized_hash(hash) l = hash["length"] s = hash["start"] txt = hash["text"] id = hash["isDuplicate"] lan = hash["language"] return IncorrectWord.new(l, s, txt, id, lan) end
@param [Integer] length The starting position of a spelled word. @param [Integer] start The starting position of a spelled word. @param [String] text The text of the spelled word. @param [Boolean] is_duplicate
Indicating whether the spelled word is
declared as incorrect, because the previous word has the same text.
@param [String] language Indicating the language the incorrect word
was spelled.
# File lib/txtextcontrol/reportingcloud/incorrect_word.rb, line 42 def initialize(length, start, text, is_duplicate, language) @length = Integer(length) @start = Integer(start) @text = text @is_duplicate = !!is_duplicate @language = language end