#! /bin/bash
 #
 # This file is part of the Anotatornia suite.
 # 
 # Copyright © 2007, 2008, 2009, 2010 by Instytut Podstaw Informatyki
 # Polskiej Akademii Nauk (IPI PAN; Institute of Computer Science, Polish
 # Academy of Sciences; cf. www.ipipan.waw.pl).  All rights reserved.
 # 
 # This file may be distributed and/or modified under the terms of the
 # GNU General Public License version 3 as published by the Free Software
 # Foundation and appearing in the file COPYING included in the packaging
 # of this file.  (See http://www.gnu.org/licenses/translations.html for
 # unofficial translations.)
 # 
 # A commercial license is available from IPI PAN (contact
 # Michal.Ciesiolka.waw.pl or ipi.waw.pl for more
 # information).  Licensees holding a valid commercial license from IPI
 # PAN may use this file in accordance with that license.
 # 
 # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
 # THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 # PURPOSE.
 #


# This script passes its optional argument to exml.rb
# Therefore the argument, if present,  has to be one of:
# --- a Ruby/Perl regular expression (in //) for matching corpus path(s)
# --- a Ruby range of numbers (such as 12..1200)---a range of paragraphs
# --- a Ruby array containing at 0th place a correct argument for anActiveRecord.find which will become id(s) of path(s) in the Anotatornia's corpus paths' table, e.g. [996]

# If no argument is given, the script will export ALL annotated data
# (which in NKJP took over 50hrs).


cd ~/anotatornia
cp -avf anotatornia_8003.db anotatornia_8007.db
cp -avf uzytkownicy_8003.db uzytkownicy_8007.db


if [ $# = 0 ]; then
    echo "load 'exml.rb'" | script/console nk8007 
else
    echo "\$arg202=$1; load 'exml.rb'" | script/console nk8007 
fi
