#!/opt/local/bin/gawk -f

#
# Copyright(C) 2007-2012 National Institute of Information and Communications Technology
#

# このファイルはEUC-JPで保存すること
# 評価表現と極性を抜き出して出力する

BEGIN {
  FS = "\t";
}

{
  if ($8 == "") next;

  sen = $5;
  mrp = $10;
  n7 = split($7, a7, /\\n/);
  n8 = split($8, a8, /\\n/);

  if (n7 != n8) error("n7 != n8");

  for (i = 1; i <= n8; i++) {
    cls = ((a7[i] == "[著者]") ? "+1" : "-1");
    xpr = a8[i];
    printf "%s\t%s\t%s\t%s\n", cls, xpr, sen, mrp;
  }
}
