From 0bcc873c3c250d4d2e403de34bb69a9f8659391f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ska=C5=82acki?= Date: Thu, 4 Mar 2021 06:05:16 +0100 Subject: [PATCH] Use topic tags when logging from TermAttrsParser --- lib/iev/termbase/term_attrs_parser.rb | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/iev/termbase/term_attrs_parser.rb b/lib/iev/termbase/term_attrs_parser.rb index cf335ce..c70b81f 100644 --- a/lib/iev/termbase/term_attrs_parser.rb +++ b/lib/iev/termbase/term_attrs_parser.rb @@ -58,7 +58,12 @@ def parse extract_usage_info(curr_str) extract_prefix(curr_str) - print_debug(curr_str) if debug? + if /\p{Word}/ =~ curr_str + debug( + :term_attributes, + "Term attributes could not be parsed completely: '#{src_str}'", + ) + end end def extract_gender(str) @@ -135,17 +140,6 @@ def remove_from_string(string, regexp) $& # removed substring or nil end end - - def print_debug(remaining_str) - if /\p{Word}/ =~ remaining_str - debug "Term attributes could not be parsed completely: " + - "'#{src_str}'" - end - end - - def debug? - $TERMBASE_DEBUG[:term_attributes] - end end end end