Vowpal Wabbit
Public Member Functions | Public Attributes | List of all members
parser Struct Reference

#include <parser.h>

Public Member Functions

 parser (size_t ring_size, bool strict_parse_)
 
 ~parser ()
 

Public Attributes

v_array< substringwords
 
v_array< substringname
 
VW::object_pool< example, example_initializerexample_pool
 
VW::ptr_queue< exampleready_parsed_examples
 
io_bufinput = nullptr
 
int(* reader )(vw *, v_array< example *> &examples)
 
void(* text_reader )(vw *, char *, size_t, v_array< example *> &)
 
hash_func_t hasher
 
bool resettable
 
io_bufoutput = nullptr
 
bool write_cache = false
 
bool sort_features = false
 
bool sorted_cache = false
 
const size_t ring_size
 
uint64_t begin_parsed_examples = 0
 
uint64_t end_parsed_examples = 0
 
uint32_t in_pass_counter = 0
 
bool emptylines_separate_examples = false
 
std::mutex output_lock
 
std::condition_variable output_done
 
bool done = false
 
v_array< size_t > gram_mask
 
v_array< size_t > ids
 
v_array< size_t > counts
 
size_t finished_count
 
int label_sock = 0
 
int bound_sock = 0
 
int max_fd = 0
 
v_array< substringparse_name
 
label_parser lp
 
bool audit = false
 
bool decision_service_json = false
 
bool strict_parse
 
std::exception_ptr exc_ptr
 

Detailed Description

Definition at line 38 of file parser.h.

Constructor & Destructor Documentation

◆ parser()

parser::parser ( size_t  ring_size,
bool  strict_parse_ 
)
inline

Definition at line 40 of file parser.h.

References simple_label.

42  {
43  this->input = new io_buf{};
44  this->output = new io_buf{};
45  this->lp = simple_label;
46 
47  // Free parser must still be used for the following fields.
48  this->words = v_init<substring>();
49  this->name = v_init<substring>();
50  this->parse_name = v_init<substring>();
51  this->gram_mask = v_init<size_t>();
52  this->ids = v_init<size_t>();
53  this->counts = v_init<size_t>();
54  }
label_parser simple_label
VW::object_pool< example, example_initializer > example_pool
Definition: parser.h:66
v_array< substring > words
Definition: parser.h:63
VW::ptr_queue< example > ready_parsed_examples
Definition: parser.h:67
v_array< size_t > counts
Definition: parser.h:94
io_buf * input
Definition: parser.h:69
v_array< substring > name
Definition: parser.h:64
v_array< substring > parse_name
Definition: parser.h:100
bool strict_parse
Definition: parser.h:107
v_array< size_t > ids
Definition: parser.h:93
v_array< size_t > gram_mask
Definition: parser.h:91
const size_t ring_size
Definition: parser.h:80
Definition: io_buf.h:54
io_buf * output
Definition: parser.h:75
label_parser lp
Definition: parser.h:102

◆ ~parser()

parser::~parser ( )
inline

Definition at line 56 of file parser.h.

57  {
58  delete input;
59  delete output;
60  }
io_buf * input
Definition: parser.h:69
io_buf * output
Definition: parser.h:75

Member Data Documentation

◆ audit

bool parser::audit = false

Definition at line 104 of file parser.h.

Referenced by enable_sources().

◆ begin_parsed_examples

uint64_t parser::begin_parsed_examples = 0

Definition at line 81 of file parser.h.

Referenced by VW::clean_example(), VW::get_unused_example(), and VW::new_unused_example().

◆ bound_sock

int parser::bound_sock = 0

Definition at line 97 of file parser.h.

Referenced by enable_sources(), and reset_source().

◆ counts

v_array<size_t> parser::counts

Definition at line 94 of file parser.h.

Referenced by free_parser().

◆ decision_service_json

bool parser::decision_service_json = false

Definition at line 105 of file parser.h.

Referenced by enable_sources(), and parse_line_json().

◆ done

bool parser::done = false

Definition at line 90 of file parser.h.

Referenced by lock_done(), and parse_dispatch().

◆ emptylines_separate_examples

bool parser::emptylines_separate_examples = false

Definition at line 84 of file parser.h.

Referenced by CSOAA::csldf_setup(), Search::setup(), and VW::setup_example().

◆ end_parsed_examples

uint64_t parser::end_parsed_examples = 0

◆ example_pool

◆ exc_ptr

std::exception_ptr parser::exc_ptr

Definition at line 108 of file parser.h.

Referenced by parse_dispatch().

◆ finished_count

size_t parser::finished_count

Definition at line 95 of file parser.h.

◆ gram_mask

v_array<size_t> parser::gram_mask

Definition at line 91 of file parser.h.

Referenced by free_parser(), and generateGrams().

◆ hasher

hash_func_t parser::hasher

◆ ids

v_array<size_t> parser::ids

Definition at line 93 of file parser.h.

◆ in_pass_counter

uint32_t parser::in_pass_counter = 0

Definition at line 83 of file parser.h.

Referenced by end_pass_example(), parse_dispatch(), and VW::setup_example().

◆ input

io_buf* parser::input = nullptr

◆ label_sock

int parser::label_sock = 0

Definition at line 96 of file parser.h.

Referenced by enable_sources().

◆ lp

label_parser parser::lp

◆ max_fd

int parser::max_fd = 0

Definition at line 98 of file parser.h.

Referenced by enable_sources().

◆ name

v_array<substring> parser::name

Definition at line 64 of file parser.h.

Referenced by free_parser().

◆ output

io_buf* parser::output = nullptr

◆ output_done

std::condition_variable parser::output_done

Definition at line 88 of file parser.h.

Referenced by VW::finish_example(), and reset_source().

◆ output_lock

std::mutex parser::output_lock

Definition at line 87 of file parser.h.

Referenced by VW::finish_example(), and reset_source().

◆ parse_name

v_array<substring> parser::parse_name

◆ reader

int(* parser::reader) (vw *, v_array< example * > &examples)

Definition at line 70 of file parser.h.

Referenced by enable_sources(), parse_cache(), parse_dispatch(), and reset_source().

◆ ready_parsed_examples

VW::ptr_queue<example> parser::ready_parsed_examples

Definition at line 67 of file parser.h.

Referenced by free_parser(), VW::get_example(), lock_done(), reset_source(), and thread_dispatch().

◆ resettable

bool parser::resettable

Definition at line 74 of file parser.h.

Referenced by enable_sources(), parse_cache(), and reset_source().

◆ ring_size

const size_t parser::ring_size

Definition at line 80 of file parser.h.

Referenced by lda_setup(), learn(), receive_result(), and sender_setup().

◆ sort_features

bool parser::sort_features = false

Definition at line 77 of file parser.h.

Referenced by parse_example_tweaks(), and VW::setup_example().

◆ sorted_cache

bool parser::sorted_cache = false

Definition at line 78 of file parser.h.

Referenced by enable_sources(), parse_cache(), and read_cached_features().

◆ strict_parse

bool parser::strict_parse

Definition at line 107 of file parser.h.

Referenced by lda_setup(), and TC_parser< audit >::parserWarning().

◆ text_reader

void(* parser::text_reader) (vw *, char *, size_t, v_array< example * > &)

Definition at line 71 of file parser.h.

Referenced by enable_sources().

◆ words

v_array<substring> parser::words

Definition at line 63 of file parser.h.

Referenced by free_parser(), and substring_to_example().

◆ write_cache

bool parser::write_cache = false

The documentation for this struct was generated from the following file: