Example #1
0
 def __init__(
         self,
         preprocessor=Preprocessor(),
         wordemb_creator=MockWordEmbeddingCreator(),
         tokenizer=JavaCodeASTTokenizer(None, None),
         preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):
     super(IdentifierEmbeddingOnlyMethods,
           self).__init__(preprocessor, wordemb_creator, tokenizer,
                          preprocessed_token_output_directory)
     self._with_class_name = False
Example #2
0
    def __init__(
            self,
            preprocessor=Preprocessor(),
            wordemb_creator=MockWordEmbeddingCreator(),
            tokenizer=JavaCodeASTTokenizer(None, None),
            preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):

        super(MethodNameSentenceEmbeddingCreator,
              self).__init__(preprocessor, wordemb_creator, tokenizer,
                             preprocessed_token_output_directory)
Example #3
0
    def __init__(
            self,
            preprocessor=Preprocessor(),
            wordemb_creator=MockWordEmbeddingCreator(),
            tokenizer=JavaCodeASTTokenizer(None, None),
            preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):
        super(IdentifierEmbeddingWithAttribute,
              self).__init__(preprocessor, wordemb_creator, tokenizer,
                             preprocessed_token_output_directory)

        self._with_attribute = True
Example #4
0
 def __init__(
         self,
         preprocessor=Preprocessor(),
         wordemb_creator=MockWordEmbeddingCreator(),
         tokenizer=JavaCodeASTTokenizer(None, None),
         preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):
     super(IdentifierEmbeddingCreatorWithMethodCommentToClass,
           self).__init__(preprocessor, wordemb_creator, tokenizer,
                          preprocessed_token_output_directory)
     self._with_class_name = True
     self._with_method = True
     self._with_method_comment_to_class = True
     self._with_class_name_to_method = True
Example #5
0
 def __init__(
         self,
         preprocessor=Preprocessor(),
         wordemb_creator=MockWordEmbeddingCreator(),
         tokenizer=JavaCodeASTTokenizer(None, None),
         preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):
     super(CodeEmbeddingCreator,
           self).__init__(preprocessor, wordemb_creator, tokenizer,
                          preprocessed_token_output_directory)
     self._is_ital_identifier = False
     self._is_ital_comm = False
     if isinstance(wordemb_creator, FastTextAlignedEngItalEmbeddingCreator):
         self._is_ital_comm = True
Example #6
0
    def __init__(
            self,
            precalculated_weights_file,
            preprocessor=Preprocessor(),
            wordemb_creator=MockWordEmbeddingCreator(),
            tokenizer=JavaCodeASTTokenizer(None, None),
            preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):

        super(TFIDFIdentifierEmbeddingCreator,
              self).__init__(preprocessor, wordemb_creator, tokenizer,
                             preprocessed_token_output_directory)

        if not precalculated_weights_file:
            log.info("No precalculated weights file read")
        else:
            self._tf_idf_data = TFIDFData(precalculated_weights_file)
Example #7
0
    def __init__(
            self,
            preprocessor=Preprocessor(),
            wordemb_creator=MockWordEmbeddingCreator(),
            tokenizer=JavaCodeASTTokenizer(None, None),
            preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):
        super(IdentifierEmbeddingOnlyClassNameAndComment,
              self).__init__(preprocessor, wordemb_creator, tokenizer,
                             preprocessed_token_output_directory)
        self._with_class_comment = True
        self._with_method = False
        self._with_class_name_to_method = False

        self._with_attribute = False
        self._with_attribute_comment_to_attr = False
        self._with_attribute_comment_to_class = False
Example #8
0
    def __init__(
            self,
            preprocessor=Preprocessor(),
            wordemb_creator=MockWordEmbeddingCreator(),
            tokenizer=JavaCodeASTTokenizer(None, None),
            preprocessed_token_output_directory=PREPROCESSED_CODE_OUTPUT_DIR):
        self._with_class_name = True
        self._with_super_classifier = False
        self._with_class_comment = False
        self._with_attribute = False
        self._with_attribute_comment_to_attr = False
        self._with_attribute_comment_to_class = False
        self._with_method = True
        self._with_method_comment_to_method = False
        self._with_method_comment_to_class = False
        self._with_method_body_to_method = False
        self._with_method_body_to_class = False
        self._with_class_name_to_method = True
        self._with_inner_classifier = False
        self._average_function = Util.create_averaged_vector  # function that maps multiple vectors to one

        super(IdentifierEmbeddingCreator,
              self).__init__(preprocessor, wordemb_creator, tokenizer,
                             preprocessed_token_output_directory)