File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
licensedb/internal/assets Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ Comparison to other projects on that dataset:
8888| [ benbalter/licensee] ( https://github.com/benbalter/licensee ) | 75% (673/902) | 111 |
8989| [ google/licenseclassifier] ( https://github.com/google/licenseclassifier ) | 76% (682/902) | 907 |
9090| [ boyter/lc] ( https://github.com/boyter/lc ) | 88% (797/902) | 548 |
91+ | [ amzn/askalono] ( https://github.com/amzn/askalono ) | 87% (785/902) | 165 |
92+ | [ LiD] ( https://source.codeaurora.org/external/qostg/lid ) | 94% (847/902) | 3660 |
9193
9294<details ><summary >How this was measured</summary >
9395<pre ><code >$ cd $(go env GOPATH)/src/gopkg.in/src-d/go-license-detector.v2/licensedb
@@ -105,6 +107,15 @@ $ time find -type f -print | xargs -n1 -P4 identify_license \
105107$ # boyter/lc
106108$ time lc . \
107109 | grep -vE 'NOASSERTION|----|Directory' | cut -d" " -f1 | sort | uniq | wc -l
110+ $ # amzn/askalono
111+ $ echo '#!/bin/sh
112+ result=$(askalono id "$1")
113+ echo "$1
114+ $result"' > ../askalono.wrapper
115+ $ time find -type f -print | xargs -n1 -P4 sh ../askalono.wrapper | grep -Pzo '.*\nLicense: .*\n' askalono.txt | grep -av "License: " | cut -d/ -f 2 | sort | uniq | wc -l
116+ $ # LiD
117+ $ time license-identifier -I dataset -F csv -O lid
118+ $ cat lid_*.csv | cut -d, -f1 | cut -d"'" -f 2 | grep / | cut -d/ -f2 | sort | uniq | wc -l
108119</code ></pre >
109120</details >
110121
Original file line number Diff line number Diff line change 1+ // +build make
2+
3+ package main
4+
5+ import (
6+ "encoding/csv"
7+ "encoding/json"
8+ "io/ioutil"
9+ "log"
10+ "os"
11+ "path"
12+ )
13+
14+ func main () {
15+ dir := os .Args [1 ]
16+ files , err := ioutil .ReadDir (dir )
17+ if err != nil {
18+ log .Fatalf ("Listing %s: %v\n " , dir , err )
19+ }
20+ writer := csv .NewWriter (os .Stdout )
21+ defer writer .Flush ()
22+ for _ , file := range files {
23+ var data map [string ]interface {}
24+ content , err := ioutil .ReadFile (path .Join (dir , file .Name ()))
25+ if err != nil {
26+ log .Fatalf ("Reading %s: %v\n " , file .Name (), err )
27+ }
28+ json .Unmarshal (content , & data )
29+ name := data ["name" ].(string )
30+ id := data ["licenseId" ].(string )
31+ writer .Write ([]string {id , name })
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments