-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpwn2maps.awk
More file actions
24 lines (22 loc) · 753 Bytes
/
Copy pathpwn2maps.awk
File metadata and controls
24 lines (22 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# https://github.com/ekaf/ski/pwn2maps.awk
# (c)2017 Eric Kafe, CC BY 4.0, https://creativecommons.org/licenses/by/4.0/
# Produce synset mappings between all Princeton WordNet versions
$0!~"^\\#"{
# For each synset key, split its set of synset ids:
z=split($2,a,",")
# Map from each synset id
for(i=1;i<z;i++){
v1=a[i]
sub(":.*","",v1)
# map to each subsequent WordNet version:
for(j=i+1;j<=z;j++){
v2=a[j]
sub(":.*","",v2)
# simple mapping strategy:
# TODO: alternative mapping strategies, f. ex. select most frequent target
print a[i],a[j] | "sort -u > " db "-map-pwn" v1 "-pwn" v2 ".txt"
# Optionally, print the inverse mapping:
# print a[j],a[i] | "sort -u > " db "-map-pwn" v2 "-pwn" v1 ".txt"
}
}
}