Table of contents

DSRawTextLine

The DSRawTextLine class represents a text line in an image. It can be in one of the following states:

  • TLS_LOCALIZED: Localized but recognition not performed.
  • TLS_RECOGNITION_FAILED: Recognition failed.
  • TLS_RECOGNIZED_SUCCESSFULLY: Successfully recognized.

Definition

Assembly: DynamsoftLabelRecognizer.xcframework

  • Objective-C
  • Swift
  1. @interface DSRawTextLine: NSObject
    
  2. class RawTextLine: NSObject
    

Methods

Methods Description
getText Returns the recognized text.
setText Sets the recognized text.
getConfidence Returns the confidence level of the recognized text.
getCharacterResults Returns all the characters contained by the textline.
getRowNumber Returns the row number of the text line within the image.
setRowNumber Sets the row number of the text line within the image.
getSpecificationName Get the name of the TextLineSpecification object that generated this TextLineResultItem.
setSpecificationName Sets the name of the TextLineSpecification object that generated this TextLineResultItem.
getLocation Returns the location of the text line.
setLocation Sets the location of the text line.

getText

Returns the recognized text.

  • Objective-C
  • Swift
  1. -(NSString*)getText;
    
  2. func getText() -> String
    

Return value

Returns the text of the text line.

setText

Returns the recognized text.

  • Objective-C
  • Swift
  1. -(NSInteger)setText:(NSString *)text;
    
  2. func setText(_ text: String) -> Int
    

Parameter

text: The text.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

getConfidence

Returns the confidence level of the recognized text.

  • Objective-C
  • Swift
  1. -(NSInteger)getConfidence;
    
  2. func getConfidence() -> Int
    

Return value

Returns the confidence level of the text line.

getCharacterResults

Returns all the characters contained by the textline in an array of DSCharacterResult.

  • Objective-C
  • Swift
  1. -(nullable NSArray<DSCharacterResult *>*)getCharacterResults;
    
  2. func getCharacterResults() -> [CharacterResult]
    

Return value

Returns all the characters contained by the textline in an array of DSCharacterResult.

getRowNumber

Returns the row number of the text line within the image.

  • Objective-C
  • Swift
  1. -(NSInteger)getRowNumber;
    
  2. func getRowNumber() -> Int
    

Return value

Returns the row number of the text line within the image.

setRowNumber

Sets the row number of the text line within the image.

  • Objective-C
  • Swift
  1. -(NSInteger)setRowNumber:(NSInteger)rowNumber;
    
  2. func setRowNumber(_ rowNumber: Int) -> Int
    

Parameter

rowNumber: The row number of the text line within the image.

Return value

Returns 0 if success, otherwise an error code.

getSpecificationName

Returns the name of the TextLineSpecification object that generated this TextLineResultItem.

  • Objective-C
  • Swift
  1. -(NSString *)getSpecificationName;
    
  2. func getSpecificationName() -> String
    

Return value

The name of the TextLineSpecification object that generated this TextLineResultItem.

setSpecificationName

Sets the name of the TextLineSpecification object that generated this TextLineResultItem.

  • Objective-C
  • Swift
  1. -(NSInteger)setSpecificationName:(NSString *)specificationName;
    
  2. func setSpecificationName(_ specificationName: String) -> Int
    

Parameter

specificationName: The name of the TextLineSpecification object that generated this TextLineResultItem.

Return value

Returns 0 if success, otherwise an error code.

getLocation

Returns a Quadrilateral object which represents the location of the text line.

  • Objective-C
  • Swift
  1. -(DSQuadrilateral *)getLocation;
    
  2. func getLocation() -> Quadrilateral
    

Return value

A Quadrilateral object which represents the location of the text line.

setLocation

Set the location of the text line.

  • Objective-C
  • Swift
  1. -(NSInteger)setLocation:(DSQuadrilateral *)location;
    
  2. func setLocation(_ location: Quadrilateral) -> Int
    

Parameter

location: The location of the text line.

Return value

Returns 0 if success, otherwise an error code.

getStatus

Returns the status of the text line.

  • Objective-C
  • Swift
  1. -(DSRawTextLineStatus)getStatus;
    
  2. func getStatus() -> RawTextLineStatus
    

Return value

The status of the text line.