Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/mast-group/naturalize

Source code for the Naturalize project
https://github.com/mast-group/naturalize

Last synced: about 2 months ago
JSON representation

Source code for the Naturalize project

Lists

README

        

Naturalize
===============
Naturalize suggests natural names for source code.

naturalize is released under a BSD license.

The project depends on three internal (maven) modules:

a) [codemining-sequencelm](https://github.com/mast-group/codemining-sequencelm)
b) [codemining-utils](https://github.com/mast-group/codemining-utils)
c) [codemining-core](https://github.com/mast-group/codemining-core)
d) [commitmining-tools](https://github.com/mast-group/commitmining-tools)

the rest of the dependencies are declared in the maven dependencies.

## Basic Usage
```java
final AbstractIdentifierRenamings renamer = new BaseIdentifierRenamings(
new JavaTokenizer());
renamer.buildRenamingModel(trainingFiles);

final SortedSet renamings = renamer
.getRenamings(new Scope(snippet,
Scope.ScopeType.SCOPE_LOCAL, null, -1, -1),
nameOfIdentifier);
```

If you need a method for directly specifying variable bindings consider
using `AbstractIdentifierRenamings.getRenamings(TokenNameBinding binding)`
that avoids retokenizing the snippet and performing a textual match on the
tokens.