Skip to content

Commit

Permalink
fixed typo build_sepereted_term -> build_separated_terms
Browse files Browse the repository at this point in the history
  • Loading branch information
idanacumen committed Feb 27, 2022
1 parent 1ada9b3 commit 2573259
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion English_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import re

from language_utils import file_scheme, term_seperator, build_sepereted_term, \
from language_utils import file_scheme, term_seperator, build_separated_terms, \
regex_to_big_query, generate_bq_function, SCHEMA_NAME


Expand Down
6 changes: 3 additions & 3 deletions abstraction_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from configuration import DATA_PATH
from language_utils import regex_to_big_query, generate_bq_function, match, SCHEMA_NAME, print_logic_to_bq\
, build_sepereted_term, build_non_positive_linguistic, REGULAR_SUFFIX, VERB_E_SUFFIX, NEAR_ENOUGH\
, build_separated_terms, build_non_positive_linguistic, REGULAR_SUFFIX, VERB_E_SUFFIX, NEAR_ENOUGH\
, programming_languges, software_goals
from model_evaluation import classifiy_commits_df, evaluate_performance, evaluate_concept_classifier

Expand Down Expand Up @@ -114,13 +114,13 @@
# Corrective
def build_core_abstraction_regex():

return build_sepereted_term(core_abstraction_terms)
return build_separated_terms(core_abstraction_terms)



def build_excluded_abstraction_regex():

return build_sepereted_term(excluded_abstraction_terms)
return build_separated_terms(excluded_abstraction_terms)


def build_not_abstraction_regex():
Expand Down
12 changes: 6 additions & 6 deletions adaptive_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from conventional_commits import build_cc_adaptive_regex
from labeling_util import get_false_positives, get_false_negatives

from language_utils import file_scheme, term_seperator, build_sepereted_term, negation_terms, modals\
from language_utils import file_scheme, term_seperator, build_separated_terms, negation_terms, modals\
, regex_to_big_query, generate_bq_function, match, SCHEMA_NAME, documentation_entities, prefective_entities\
, software_terms, build_non_positive_linguistic, software_goals_modification, software_goals, unnedded_terms\
, code_review_fixes, no_message, NEAR_ENOUGH
Expand Down Expand Up @@ -125,7 +125,7 @@ def build_adaptive_action_regex():

def build_adaptive_regex(use_conventional_commits=True):

adaptive_context_re = build_sepereted_term(adaptive_context, just_before=True)
adaptive_context_re = build_separated_terms(adaptive_context, just_before=True)


base_re = "((%s)\s[\s\S]{0,50}(%s)%s)" % (adaptive_context_re
Expand Down Expand Up @@ -162,10 +162,10 @@ def build_non_adaptive_context():
non_adaptive_entities = documentation_entities + software_terms + unnedded_terms + [file_scheme]


return '(%s)' % "|".join(['(?:%s)\s[\s\S]{0,50}(?:%s)' % (build_sepereted_term(adaptive_context, just_before=True)
return '(%s)' % "|".join(['(?:%s)\s[\s\S]{0,50}(?:%s)' % (build_separated_terms(adaptive_context, just_before=True)
, "|".join(entities))
, non_adaptive_header
, '(?:%s)\s[\s\S]{0,50}(?:%s)' % (build_sepereted_term(adaptive_actions, just_before=True)
, '(?:%s)\s[\s\S]{0,50}(?:%s)' % (build_separated_terms(adaptive_actions, just_before=True)
, "|".join(non_adaptive_entities))
])

Expand All @@ -185,7 +185,7 @@ def is_adaptive(text):

def build_core_adaptive_regex():

return '(%s)' % build_sepereted_term(core_adaptive_terms)
return '(%s)' % build_separated_terms(core_adaptive_terms)

def is_core_adaptive(text):

Expand Down Expand Up @@ -282,7 +282,7 @@ def evaluate_adaptive_classifier():

if __name__ == '__main__':
print_adaptive_functions(commit='4b76d8e76af938824f91f4b99247731c21e37ff9')
evaluate_adaptive_classifier()
#evaluate_adaptive_classifier()

text = """
"Leverage pip to access installed packages
Expand Down
16 changes: 8 additions & 8 deletions corrective_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from conventional_commits import build_cc_corrective_regex
from labeling_util import get_false_positives, get_false_negatives

from language_utils import file_scheme, term_seperator, build_sepereted_term, negation_terms, modals\
from language_utils import file_scheme, term_seperator, build_separated_terms, negation_terms, modals\
, regex_to_big_query, generate_bq_function, match, SCHEMA_NAME, documentation_entities, prefective_entities\
, static_analyzers, NEAR_ENOUGH, software_entities, code_review_fixes, normalize
from model_evaluation import classifiy_commits_df, evaluate_performance
Expand Down Expand Up @@ -169,9 +169,9 @@
'(if|would)[\s\S]{0,40}go wrong',
'line(?:s)? break(?:s)?',
'typo(s)?\sfix(es)?',
'fix(ed|es|ing)?' + build_sepereted_term(software_entities) + 'name(s)?',
build_sepereted_term(static_analyzers) + 'fix(es|ed)?',
'fix(es|ed)?' + build_sepereted_term(static_analyzers) ,
'fix(ed|es|ing)?' + build_separated_terms(software_entities) + 'name(s)?',
build_separated_terms(static_analyzers) + 'fix(es|ed)?',
'fix(es|ed)?' + build_separated_terms(static_analyzers) ,
'^### Bug Fix', # tends to be a title, later stating if the commit is a bug fix
'edit the jira link to the correct issue', # Another occurring title
'page(?:s)? break(?:s)?',
Expand Down Expand Up @@ -214,7 +214,7 @@ def build_valid_find_regex():
# (valid_fix_object) + ")" + sepertion + fix_re + term_seperator

#other_valid_re = "(%s)" % "|".join(valid_terms)
other_valid_re = build_sepereted_term(valid_terms)
other_valid_re = build_separated_terms(valid_terms)
return "((%s)|(%s)|(%s))" % (prefix, suffix, other_valid_re)


Expand All @@ -225,7 +225,7 @@ def build_bug_fix_regex(use_conventional_commits=True):
# strict_header = "^(?:%s)%s" % ( "|".join([ "do not" ,"don't"])
# , term_seperator)

bug_fix_re = build_sepereted_term(bug_terms)
bug_fix_re = build_separated_terms(bug_terms)


if use_conventional_commits:
Expand All @@ -237,15 +237,15 @@ def build_bug_fix_regex(use_conventional_commits=True):

def build_negeted_bug_fix_regex():
bug_fix_re = build_bug_fix_regex(use_conventional_commits=False)
negation_re = build_sepereted_term(negation_terms)
negation_re = build_separated_terms(negation_terms)


return "%s[\s\S]{0,20}%s" % (negation_re, bug_fix_re)


def build_core_bug_regex():

return '(%s)' % build_sepereted_term(core_bug_terms)
return '(%s)' % build_separated_terms(core_bug_terms)

def is_core_bug(commit_text):
text = commit_text.lower()
Expand Down
6 changes: 3 additions & 3 deletions good_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

from configuration import DATA_PATH
from language_utils import regex_to_big_query, generate_bq_function, match, SCHEMA_NAME, print_logic_to_bq\
, build_sepereted_term, build_non_positive_linguistic
, build_separated_terms, build_non_positive_linguistic
from model_evaluation import classifiy_commits_df, evaluate_performance, evaluate_concept_classifier

# Not sure list
Expand Down Expand Up @@ -154,13 +154,13 @@

def build_positive_regex():

return build_sepereted_term(positive_terms)
return build_separated_terms(positive_terms)



def build_excluded_regex():

return build_sepereted_term(excluded_terms)
return build_separated_terms(excluded_terms)

def build_not_positive_regex():

Expand Down
10 changes: 5 additions & 5 deletions language_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
'Open Policy Agent', 'RobotFramework']]


def build_sepereted_term(term_list : List, just_before =False):
def build_separated_terms(term_list : List, just_before =False):
if just_before:
sep = "%s(%s)" % (term_seperator, "|".join(term_list))
else:
Expand All @@ -222,14 +222,14 @@ def build_non_positive_linguistic(positive_re


return '(?:%s)' % "|".join([
('(?:%s)' + NEAR_ENOUGH + '(?:%s)') % (build_sepereted_term(modals, just_before=True)
('(?:%s)' + NEAR_ENOUGH + '(?:%s)') % (build_separated_terms(modals, just_before=True)
, positive_re)
, ('(?:%s)' + NEAR_ENOUGH + '(?:%s)') % (build_sepereted_term(neg, just_before=True)
, ('(?:%s)' + NEAR_ENOUGH + '(?:%s)') % (build_separated_terms(neg, just_before=True)
, positive_re)
, ('(?:%s)' + NEAR_ENOUGH + '(?:%s)') % (build_sepereted_term(non_actionable_context, just_before=True)
, ('(?:%s)' + NEAR_ENOUGH + '(?:%s)') % (build_separated_terms(non_actionable_context, just_before=True)
, positive_re)
# TODO - take care of documentation entities spereatly
#, '(?:%s)[\s\S]{0,10}(?:%s)' % (build_sepereted_term(documentation_entities, just_before=True)
#, '(?:%s)[\s\S]{0,10}(?:%s)' % (build_separated_terms(documentation_entities, just_before=True)
# ,positive_re)
])

Expand Down
6 changes: 3 additions & 3 deletions performance_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from configuration import DATA_PATH
from language_utils import regex_to_big_query, generate_bq_function, match, SCHEMA_NAME, print_logic_to_bq\
, build_sepereted_term, build_non_positive_linguistic, REGULAR_SUFFIX, NEAR_ENOUGH, VERB_E_SUFFIX
, build_separated_terms, build_non_positive_linguistic, REGULAR_SUFFIX, NEAR_ENOUGH, VERB_E_SUFFIX
from model_evaluation import classifiy_commits_df, evaluate_performance, evaluate_concept_classifier

# Not sure list
Expand Down Expand Up @@ -51,13 +51,13 @@

def build_positive_regex():

return build_sepereted_term(positive_terms)
return build_separated_terms(positive_terms)



def build_excluded_regex():

return build_sepereted_term(excluded_terms)
return build_separated_terms(excluded_terms)

def build_not_positive_regex():

Expand Down
Loading

0 comments on commit 2573259

Please sign in to comment.