GithubHelp home page GithubHelp logo

autocomment's Introduction

Automated Comment Generation for JAVA

Type git clone https://github.com/nerzid/autocomment.git in your favorite terminal to download the project.

Feel free to Fork and send Pull Requests 👍

📢 To Do List

  • Use a logging library instead of a custom one.
  • Gather at least 10.000 java files for training process. Current count Approximately: 2.200.
  • Finish all of the javadocs.
  • Prepare Wiki section for newcomers.

[Checkout License] (https://github.com/nerzid/autocomment/blob/master/LICENSE)

autocomment's People

Contributors

nerzid avatar

Watchers

James Cloos avatar Ali Buğra Kanburoğlu avatar  avatar  avatar

Forkers

bellmit

autocomment's Issues

Integrating call graph extractor with main app

Current call graph extractor doesn't have a db connection, all info stored locally. But the same info is already stored in db.

So make use of existing db to find the invoked methods.

Interface of call graph extractor:

getListOfInvokedMethods ( classOfCallerMethod, callerMethodSignature)

Outputs:

list of (classOfCalleeMethod, calleeMethodSignature)

Exclude common methods from DB

e.g. equals() , run() , toString(), init() ...

They don't need templates to be explained. All developers know their meanings already.

Hardcode some of the known identifiers' postags

Core NLP Stanford Toolkit recognize those verbs as NP which is incorrect. Im going to hardcode some of the identifiers. Below is the current list that we'll be converted to VB .

  • sort
  • fire
  • copy
  • swap
  • check
  • process
  • append
  • dump
  • print
  • println
  • register
  • resolve
  • start
  • end
  • visit
  • fill
  • search
  • use
  • clone

Ignore get/set methods for training process

Get and Set methods (Accessors and Mutators) must be exluded from train proces. Their comment template are already easy to do. Therefore they'r not needed in database.

📢 IMPORTANT

This kind of get() method must be excluded

public int getCount(){
    return count;
}

but following one has some operations in it, therefore it shouldn't be excluded

public int getAverageGradeOfStudents(){
    double sum = 0;
    for(Student s: student_list){
        sum += s.getGrade();
    }
    return (sum / student_list.size());
}

Method Comment Template - Title

The following template can be used to synthesize descriptive comments based on method signature:

VP -->V + NP + [PP]
PP -->Prep + NP
NP --> Noun | Pronoun

VP: Verb phrase
PP: Prepositional Phrase
NP: Noun phrase

Training process ignores punctuations always

Example:

Collection of Listboolean

Where it should be like following:
Collection of List< boolean >

Problem comes from
com.nerzid.autocomment.nlp.Tokenizer.simplifyDataType(String data_type)

Simplify the output of 'data_type'

Simplify the data data_type in db and new data must be stored in a new simplified way.

Example 1

Current output:

java.nio.charset.Charset

Simplified output:

Charset

Example 2

Current output:

java.io.File[]

Simplified output:

Array of File or Collection of File

Example 3

Current output:

java.util.SortedMap<java.lang.String, java.nio.charset.Charset>

Simplified output:

Collection of Charset

Example 4

Current output:

java.util.Set<java.util.Map.Entry<java.lang.String, java.lang.Object>>

Simplified output:

?

Resolve user defined class names

Split the class names into components

For example a class named as
SoftwareEngineering

should be splitted as
Softwareand Engineering.

The results should be stored into another table called UserDefinedType.

Should we exclude test methods ?

identifier -> testReadSwapped()
splitted_identifier -> test read swapped
postag -> NN VBD VBD

I think test methods are not needed since their identifiers explain the situtation mostly and it would be better if the developer itself writes its javadoc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.