QuerySyntaxParser

class squirro.lib.nlp.apps.query_processing.QuerySyntaxParser(config)

Bases: squirro.lib.nlp.steps.batched_step.BatchedStep

Parse query to separate User-Query-Terms from filter tokens.

Parameters
  • step (str, "app") – app

  • type (str, "query_processing") – query_processing

  • name (str, "syntax_parser") – syntax_parser

  • input_field (str,"query") – query

  • output_user_terms (str, "user_terms") – user terms as list

  • output_user_terms_str (str, "user_terms_str") – user terms as str

  • output_facet_filters (str, "facet_filters") – facet filters as list

  • output_query_length (str, "query_length") – query length as integer

  • path (str, ".") – schema expects path where step file is located. not used actually

Methods Summary

parse_query(query)

Parse query into: - enrichable tokens: natural language style user terms - non-enrichable tokens: query-syntax rules like facet filters, comparisons etc.

process_doc(doc)

Process a document

Methods Documentation

parse_query(query)

Parse query into: - enrichable tokens: natural language style user terms - non-enrichable tokens: query-syntax rules like facet filters, comparisons etc.

Parameters

query – Searchbar query text (contains possible squirro-query-syntax logic)

Return type

ParsedQuery

Returns

parsed query

process_doc(doc)

Process a document

Parameters

doc (Document) – Document

Returns

Processed document

Return type

Document