Skip to content
Snippets Groups Projects
Commit 20d367d9 authored by Pawel Orlowicz's avatar Pawel Orlowicz
Browse files

description

parent 7e52f5e3
Branches
No related merge requests found
#!/usr/bin/perl
#Script takes two arguments: corpus directory (DIR) and relation name (REL) that is going to be swapped.
#In all files within DIR swap direction of all relations with name REL by swapping chan attributes of nodes: <from> and <to> and it's text nodes
#e.g.
#<rel name="cop">
# <from chan="NP">3</from>
# <to chan="VP">1</to>
#</rel>
# swap: NP with VP and 3 with 1:
#<rel name="cop">
# <from chan="VP">1</from>
# <to chan="NP">3</to>
#</rel>
use File::Find;
if ( @ARGV == 2 ){
......@@ -54,6 +67,6 @@ sub wanted{
}
}else{
print "USAGE: swapchans.pl directory relation_name\n";
print "In given directory (DIR) change direction of all relations with name REL by swapping attribute chan between <from> and <to> nodes";
print "\n\nUSAGE: swapchans.pl DIR REL\n";
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment