Documentation ¶
Index ¶
- Constants
- Variables
- func AlignmentDistance(sNodes, tNodes []*Node) (sum float64, err error)
- func FileClassifier(filePath, language string) (int, error)
- func MinCostFlow(g *Graph, s int, t int, inif int) int
- func NodeDataDiff(sNode *Node, tNode *Node) (res float64)
- func OutputAbstractRepository(nodes []*Node, outPath string, thr float64) error
- func SwapNodeSlice(sNodes, tNodes []*Node) ([]*Node, []*Node)
- type Edge
- type Graph
- type McfNode
- type Node
- type NodeInfo
Constants ¶
View Source
const ( MaxFiletype = 7 TypeOther = 0 TypeSource = 1 TypeBuild = 2 TypeConfig = 3 TypeStatic = 4 TypeDocument = 5 TypeImage = 6 )
View Source
const INF = 10000000
View Source
const MaxV = 50000
Maximum number of network nodes
View Source
const SIGINIGICANT_DIGITS = 100000
Variables ¶
View Source
var ( GoSourceRegex = regexp.MustCompile(`.*\.go$`) JsSourceRegex = regexp.MustCompile(`.*\.(js|jsx|_js|bones|cjs|es|es6|frag|gs|jake|jsb|jscad|jsfl|jsm|jss|mjs|njs|pac|sjs|ssjs|xsjs|xsjslib|js\.erb|vue|)$`) PythonSourceRegex = regexp.MustCompile(`.*\.(py|pyx|pxd|pxi|numpy|numpyw|numsc|bzl|cgi|fcgi|gyp|gypi|lmi|py3|pyde|pyi|pyp|pyt|pyw|rpy|smk|spec|tac|wsgi|xpy|pytb|sage|sagews)$`) JavaSourceRegex = regexp.MustCompile(`.*\.(java|properties|jsp)$`) PhpSourceRegex = regexp.MustCompile(`.*\.(php|hack|hh|hhi|aw|ctp|fcgi|inc|php3|php4|php5|phps|php_cs|php_cs\.dist|zig)$`) CsharpSourceRegex = regexp.MustCompile(`.*\.(cs|cake|csx)$`) CppSourceRegex = regexp.MustCompile(`.*\.(cpp|c\+\+|cc|cp|cxx|h|h\+\+|hh|hpp|hxx|inc|inl|ino|ipp|re|tcc|tpp)$`) TypescriptSourceRegex = regexp.MustCompile(`.*\.(ts|tsx)$`) ShellSourceRegex = regexp.MustCompile(`(.*\.(sh|ebuild|eclass|ps1|psd1|psm1|bash|bats|cgi|command|fcgi|ksh|sh\.in|tmux|tool|zsh|tcsh|csh|fish)$)|(^(\.(bash_aliases|bash_history|bash_logout|bash_profile|bashrc|cshrc|login|profile|zlogin|zlogout|zprofile|zshenv|zshrc)|9fs|PKGBUILD|bash_aliases|bash_logout|bash_profile|bashrc|cshrc|gradlew|login|man|profile|zlogin|zlogout|zprofile|zshenv|zshrc)$)`) CSourceRegex = regexp.MustCompile(`.*\.(c|cats|h|idc)$`) RubySourceRegex = regexp.MustCompile(`(.*\.(rb|builder|eye|fcgi|gemspec|god|jbuilder|mspec|pluginspec|podspec|rabl|rake|rbi|rbuild|rbw|rbx|ru|ruby|spec|thor|watchr)$)|(^(\.irbrc|\.pryrc|Appraisals|Berksfile|Brewfile|Buildfile|Capfile|Dangerfile|Deliverfile|Fastfile|Gemfile|Gemfile\.lock|Guardfile|Jarfile|Mavenfile|Podfile|Puppetfile|Rakefile|Snapfile|Thorfile|Vagrantfile|buildfile)$)`) BuildfileRegex = regexp.MustCompile(`(.*\.(mak|d|make|mk|mkfile|dockerfile)$)|(^(Makefile|BSDmakefile|GNUmakefile|Kbuild|Makefile\.am|Makefile\.boot|Makefile\.frag|Makefile\.in|Makefile\.inc|Makefile\.wat|makefile|makefile\.sco|mkfile|Dockerfile)$)`) ConfigfileRegex = regexp.MustCompile(`.*\.(env|cfg)$`) StaticfileRegex = regexp.MustCompile(`.*\.(html|htm|html\.hl|inc|st|xht|xhtml|jinja|jinja2|mustache|njk|ecr|eex|erb|erb\.deface|phtml|cshtml|razor|haml|haml\.deface|handlebars|hbs|kit|latte|liquid|mtml|marko|jade|pug|rhtml|scaml|slim|svelte|twig|css|less|mss|pcss|postcss|sass|styl|sss|scss)$`) DocumentsRegex = regexp.MustCompile(`.*\.(md|markdown|mdown|mdwn|mdx|mkd|mkdn|mkdown|ronn|wrokbook|rmd|txt)$`) )
see https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
Functions ¶
func AlignmentDistance ¶
func FileClassifier ¶
func NodeDataDiff ¶
func SwapNodeSlice ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.