OCRController class

Constructors

OCRController()
factory

Properties

afterLines List<Line>
getter/setter pair
averageLineLength int
getter/setter pair
beforeLines List<Line>
getter/setter pair
googleText String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isSortComplete bool
getter/setter pair
isSortCompleteVertical bool
getter/setter pair
occ → OCRKitController
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sortedResult String
getter/setter pair
sortedResultVertical String
getter/setter pair
spaceBetweenWords String
getter/setter pair
spaceBetweenWordsVertical String
getter/setter pair
waitComplete bool
getter/setter pair

Methods

checkSimilarity(String s1, String s2, {bool caseSensitive = false}) → dynamic
checks if two strings are similar or not. WillDo: gives a percentage
containsNumber(String s) → dynamic
disableSlope(List<Line>? lines) Future<List<Line>?>
this function gets line list and removes the slope handles problem of rotated images
doesNamesContain2String(String? name, String? family, List<String> inputNames) List
checks whether name and family have been in inputNames or not. the first item of the list returned is the bool result and the second is the String result.
doesNamesContainString(String? string, List<String> inputNames) List
checks whether name and family have been in inputNames or not. the first item of the list returned is the bool result and the second is the String result.
exclusiveLineFiller(List<Line> lineList, List<Line> nameList, List<Line> maxList, int maxNameCount) Future<List<Line>>
This algorithm takes a line list and fills it with temp Lines so all list lines follow one set of rules
exclusiveLineSort(List<Line> lineList) Future<List<Line>>
exclusiveLineSortFaster(List<Line> lineList, {List<Line> removeLines = const []}) Future<List<Line>>
Algorithm set to handle a special sort
extractPassengersData(List<Line> lines, List<String> inputNames) → dynamic
new function used to extract flight passenger data using input names for a dcs passenger list.
findClosetLine(Line line, List<Line> allLines) Line
Finds a Line which is the closets to the line from the right side. for example we can use it when we have the first name and we want to extract the last name on the right of it.
findClosetLineVertical(Line line, List<Line> allLines, {bool fromBot = true}) Line
Finds a Line which is the closets to the line from the bottom.
findFlightTags(List<Line>? lines) Future<List<String>>
findPassengers(String horizontalSort, List<Line> allLines, List<String> inputNames) Future<List<Map<String, dynamic>>>
find passengers
findSameLines(List<Line> allLines, List<Line> sameLines, String spaceBetweenWords, bool isHorizontal, int strictness) → dynamic
this finds same line words of the found words.
getNamesList(String path, List<String> inputNames, int strictness) Future<List<Map<String, dynamic>>>
getNumberList(String path) Future<List<String>>
this function extracts all numbers of an image which have 6 or more digits removes time and date
getPassengerList(String path, List<String> inputNames) Future<List<Map<String, dynamic>>>
this function extracts list of data of passengers of a brs flight table.
getPassengerListByOCRData(Map<String, dynamic> data, List<String> inputNames) Future<List<Map<String, dynamic>>>
this function extracts list of data of passengers of a brs flight table.
initialize(Map<String, dynamic> output, {List<String> removeFromTopWords = const [], List<String> removeFromTopWords2 = const []}) Future<List<Line>?>
initSort(List<Line>? allLines, {int spaceBetweenWordsCount = 4, bool isHorizontal = true, int strictness = 1}) → dynamic
isInTheSameColumn(Line l1, Line l2, Strictness strictness) bool
Checks if words are vertically in the same Column! //So important and useful
isInTheSameLine(Line l1, Line l2, Strictness strictness) bool
Same line Check! //So important and useful strictness can be hard or medium //the first is more accurate and second one is more sensitive
isInTheSameSlope(Line l1, Line l2, {dynamic limit = 40}) bool
Considers the slope for checking being in the Same line uses the average slope of both lines
isPassengerBag(String s) → dynamic
format: "0/0", "1/12" contains "/", and two numbers two side of it
isPassengerID(String s) → dynamic
format: "2100635585", "1361535733", "00A7925289", "00A4781591"; contains 10(sometimes 9) characters, mostly numbers;
isPassengerSeat(String s) → dynamic
format: "1B", "1A", "2A", "12A", "299C"; contains a number less than 300 and an alpha letter (a-zA-Z)
isPassengerSequence(String s) → dynamic
format: "101", "102", "103" it's a number up to 1000
leastXFinder(List<Line> lines, {bool useMiddle = false}) → dynamic
can find leastX based on the middle height
leastYFinder(List<Line> lines) → dynamic
based on the left part of the word
maxXFinder(List<Line> lines) → dynamic
based on the left part of the word
maxYFinder(List<Line> lines, {bool useMiddle = false}) → dynamic
can find maxY based on the middle width
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
slopeOfLine(Line l) → dynamic
this function returns the slope of a single word this can be very useful
sortLines(List<Line>? lines, String spaceBetweenWords, bool isHorizontal, int strictness) → dynamic
sorts using recursive! Ends the sort at the end.
toString() String
A string representation of this object.
inherited
validateFeatureInLine(String line, double percent, bool validate(String)) bool
takes a String (line) which is a line and contains a list of Strings joined with space and each one of them much validate. if most of them returned true then the function must return true
waitWhile(bool test(), [Duration pollInterval = Duration.zero]) Future
this is a check that ensures the sort is ended!

Operators

operator ==(Object other) bool
The equality operator.
inherited