qat.core.BatchResult

class qat.core.BatchResult(**kwargs)

Simple higher level wrapper for the serializable BatchResult class.

Parameters:

kwargs (keyword arguments) – accepted arguments are results (a list of Result objects) and meta_data (a (str, str) map).

Instance attributes:
  • results (list<Result>): list of results

  • meta_data (dict<str, str>): meta data

append(value)

Add a result in the list of results

Parameters:

value (Result)

dump(fname)

Dumps the Qaptiva object in a binary file

Warning

The filename name can be extended to have extension ".bres"

Parameters:

fname (str) – the file name

extend(values)

Add several results in the list of results

Parameters:

values (list<Result>)

property file_extension: str

Read-only property returning the file extension used by dump()

classmethod from_thrift(tobject)

Builds a BatchResult object from a thrift object

classmethod load(fname)

Loads a Qaptiva object from a binary file

Warning

The filename name can be extended to have an extension

Parameters:

fname (str) – the file name

Returns:

An instance of the loaded object

to_thrift()

Cast the BatchResult into a pure Thrift object