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

description

parent 7e52f5e3
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl #!/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; use File::Find;
if ( @ARGV == 2 ){ if ( @ARGV == 2 ){
...@@ -54,6 +67,6 @@ sub wanted{ ...@@ -54,6 +67,6 @@ sub wanted{
} }
}else{ }else{
print "In given directory (DIR) change direction of all relations with name REL by swapping attribute chan between <from> and <to> nodes";
print "USAGE: swapchans.pl directory relation_name\n"; print "\n\nUSAGE: swapchans.pl DIR REL\n";
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment