wiki:UTT Based on Examples

UTT Based on Examples

Author: Mateusz Boryga

Contents

  1. Contents
  2. tok
  3. lem
  4. gue
  5. cor
  6. kor
  7. sen
  8. ser
  9. grp
  10. mar
  11. kot
  12. fla
  13. unfla
  14. help
  15. version

tok

tok.1.

Description:

Change raw text into list of tokens.

Command:

echo 'W moim domu jest zawsze głośno. Stoi przy ruchliwej ulicy.' | tok

Output:

0000 01 W W
0001 01 S _
0002 04 W moim
0006 01 S _
0007 04 W domu
0011 01 S _
0012 04 W jest
0016 01 S _
0017 06 W zawsze
0023 01 S _
0024 06 W głośno
0030 01 P .
0031 01 S _
0032 04 W Stoi
0036 01 S _
0037 04 W przy
0041 01 S _
0042 09 W ruchliwej
0051 01 S _
0052 05 W ulicy
0057 01 P .
0058 01 S \n

lem

lem.1.

Description:

Perform morphological analysis.

Command:

echo 'Ulicą jedzie szybki i zielony samochód.' | tok | lem

Output:

0000 05 W Ulicą lem:ulica,N/CiGfNs
0005 01 S _
0006 06 W jedzie lem:jechać,V/AiMdNsP3R-TfrVp
0012 01 S _
0013 06 W szybki lem:szybki,ADJ/CaDpGiNs
0013 06 W szybki lem:szybki,ADJ/CnvDpGaipNs
0013 06 W szybki lem:szybka,N/CaGfNp
0013 06 W szybki lem:szybka,N/CgGfNs
0013 06 W szybki lem:szybka,N/CnGfNp
0013 06 W szybki lem:szybka,N/CvGfNp
0019 01 S _
0020 01 W i lem:i,CONJ
0020 01 W i lem:i,EXCL
0021 01 S _
0022 07 W zielony lem:zielony,ADJ/CaDpGiNs
0022 07 W zielony lem:zielony,ADJ/CnvDpGaipNs
0029 01 S _
0030 08 W samochód lem:samochód,N/CaGiNs
0030 08 W samochód lem:samochód,N/CnGiNs
0038 01 P .
0039 01 S \n

lem.2.

Description:

Perform morphological analysis. Print ambiguous annotation in one output line by generating multiple annotation fields.

Command:

echo 'Ulicą jedzie szybki i zielony samochód.' | tok | lem --one-line

Output:

0000 05 W Ulicą lem:ulica,N/CiGfNs
0005 01 S _
0006 06 W jedzie lem:jechać,V/AiMdNsP3R-TfrVp
0012 01 S _
0013 06 W szybki lem:szybki,ADJ/CaDpGiNs lem:szybki,ADJ/CnvDpGaipNs lem:szybka,N/CaGfNp lem:szybka,N/CgGfNs lem:szybka,N/CnGfNp lem:szybka,N/CvGfNp
0019 01 S _
0020 01 W i lem:i,CONJ lem:i,EXCL
0021 01 S _
0022 07 W zielony lem:zielony,ADJ/CaDpGiNs lem:zielony,ADJ/CnvDpGaipNs
0029 01 S _
0030 08 W samochód lem:samochód,N/CaGiNs lem:samochód,N/CnGiNs
0038 01 P .
0039 01 S \n

lem.3.

Description:

Perform morphological analysis. Print ambiguous annotation in one annotation field.

Command:

echo 'Ulicą jedzie szybki i zielony samochód.' | tok | lem -1

Output:

0000 05 W Ulicą lem:ulica,N/CiGfNs
0005 01 S _
0006 06 W jedzie lem:jechać,V/AiMdNsP3R-TfrVp
0012 01 S _
0013 06 W szybki lem:szybki,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs;szybka,N/CaGfNp,N/CgGfNs,N/CnGfNp,N/CvGfNp
0019 01 S _
0020 01 W i lem:i,CONJ,EXCL
0021 01 S _
0022 07 W zielony lem:zielony,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0029 01 S _
0030 08 W samochód lem:samochód,N/CaGiNs,N/CnGiNs
0038 01 P .
0039 01 S \n

gue

gue.1.

Description:

Guess morphological descriptions.

Command:

echo 'smerfny' | tok | gue

Output:

0000 07 W smerfny gue:smerfny,ADJ/CaDpGiNs
0000 07 W smerfny gue:smerfny,ADJ/CnvDpGaipNs
0007 01 S \n

gue.2.

Description:

Guess morphological descriptions. Print ambiguous annotation in one output line by generating multiple annotation fields.

Command:

echo 'smerfny' | tok | gue --one-line

Output:

0000 07 W smerfny gue:smerfny,ADJ/CaDpGiNs gue:smerfny,ADJ/CnvDpGaipNs
0007 01 S \n

gue.3.

Description:

Guess morphological descriptions. Print ambiguous annotation in one annotation field.

Command:

echo 'smerfny' | tok | gue -1

Output:

0000 07 W smerfny gue:smerfny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0007 01 S \n

cor

cor.1.

Description:

Correct spelling.

Command:

echo 'kresło' | tok | cor

Output:

0000 06 W kresło cor:kresko
0000 06 W kresło cor:kreso
0000 06 W kresło cor:krzesło
0006 01 S \n

cor.2.

Description:

Correct spelling. Print ambiguous annotation in one output line by generating multiple annotation fields.

Command:

echo 'kresło' | tok | cor --one-line

Output:

0000 06 W kresło cor:kresko cor:kreso cor:krzesło
0006 01 S \n

cor.3.

Description:

Correct spelling. Print ambiguous annotation in one annotation field.

Command:

echo 'kresło' | tok | cor -1

Output:

0000 06 W kresło cor:kresko;kreso;krzesło
0006 01 S \n

cor.4.

Description:

Correct spelling. Change maximum edit distance into 2.

Command:

echo 'kzzeslo' | tok | cor -n 2

Output:

0000 07 W kzzeslo cor:krzesko
0000 07 W kzzeslo cor:krzesło
0007 01 S \n

kor

kor.1.

Description:

Correct spelling.

Command:

echo 'kresło' | tok | kor

Output:

0000 06 W kresło kor:krzesło
0000 06 W kresło kor:kreso
0000 06 W kresło kor:kresko
0006 01 S \n

kor.2.

Description:

Correct spelling. Print ambiguous annotation in one output line by generating multiple annotation fields.

Command:

echo 'kresło' | tok | kor --one-line

Output:

0000 06 W kresło kor:krzesło kor:kreso kor:kresko
0006 01 S \n

kor.3.

Description:

Correct spelling. Print ambiguous annotation in one annotation field.

Command:

echo 'kresło' | tok | kor -1

Output:

0000 06 W kresło kor:krzesło;kreso;kresko
0006 01 S \n

kor.4.

Description:

Correct spelling. Change maximum edit distance into 3.

Command:

echo 'pisemy' | tok | kor -n 3

Output:

0000 06 W pisemy kor:piszmy
0000 06 W pisemy kor:piszemy
0000 06 W pisemy kor:pisemny
0006 01 S \n

kor.5.

Description:

Correct spelling. Add operations' weights file.

Command:

echo 'grzegrzułka' | tok | kor -w w.kor

File w.kor:

%stdcor 1
%xchg   1
ż rz 0.3
u ó  0.3

Output:

0000 11 W grzegrzułka kor:gżegżółka
0011 01 S \n

sen

sen.1.

Description:

Detect sentence boundaries. Mark beginning (BOS) and end (EOS) of each sentence.

Command:

echo 'Ala? Ala ma kota. Kot ma Alę.' | tok | sen

Output:

0000 00 BOS *
0000 03 W Ala
0003 01 P ?
0004 00 EOS *
0004 00 BOS *
0004 01 S _
0005 03 W Ala
0008 01 S _
0009 02 W ma
0011 01 S _
0012 04 W kota
0016 01 P .
0017 00 EOS *
0017 00 BOS *
0017 01 S _
0018 03 W Kot
0021 01 S _
0022 02 W ma
0024 01 S _
0025 03 W Alę
0028 01 P .
0029 01 S \n
0030 00 EOS *

ser

ser.1.

Description:

Find pattern 'word(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -e 'word(dom)'

Output:

0000 01 W O lem:o,EXCL,P/Cal
0001 01 S _
0002 06 W Białym lem:biały,ADJ/CdDpNp,ADJ/CilDpGainpNs
0008 01 S _
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 01 S _
0014 04 W mówi lem:mówić,V/AiMdNsP3R-TfrVp
0018 01 S _
0019 03 W się lem:się,NPRO/CaZx,NPRO/CgZx
0022 01 P ,
0023 01 S _
0024 02 W że lem:że,CONJ,PART
0026 01 S _
0027 02 W to lem:to,CONJ,NPRO/CaGnNsZd,NPRO/CnGnNsZd,PART;ten,ADJPRO/CanvGnNsZd
0029 01 S _
0030 04 W duży lem:duży,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0034 01 S _
0035 12 W funkcjonalny lem:funkcjonalny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0047 01 S _
0048 00 BOM * ser:1
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:1
0051 01 P .
0052 01 S \n

ser.2.

Description:

Find pattern 'word(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -m -e 'word(dom)'

Output:

0048 00 BOM * ser:1
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:1

ser.3.

Description:

Find pattern 'lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -e 'lexeme(dom)'

Output:

0000 01 W O lem:o,EXCL,P/Cal
0001 01 S _
0002 06 W Białym lem:biały,ADJ/CdDpNp,ADJ/CilDpGainpNs
0008 01 S _
0009 00 BOM * ser:1
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 00 EOM * ser:1
0013 01 S _
0014 04 W mówi lem:mówić,V/AiMdNsP3R-TfrVp
0018 01 S _
0019 03 W się lem:się,NPRO/CaZx,NPRO/CgZx
0022 01 P ,
0023 01 S _
0024 02 W że lem:że,CONJ,PART
0026 01 S _
0027 02 W to lem:to,CONJ,NPRO/CaGnNsZd,NPRO/CnGnNsZd,PART;ten,ADJPRO/CanvGnNsZd
0029 01 S _
0030 04 W duży lem:duży,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0034 01 S _
0035 12 W funkcjonalny lem:funkcjonalny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0047 01 S _
0048 00 BOM * ser:2
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:2
0051 01 P .
0052 01 S \n

ser.4.

Description:

Find pattern 'lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -m -e 'lexeme(dom)'

Output:

0009 00 BOM * ser:1
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 00 EOM * ser:1
0048 00 BOM * ser:2
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:2

ser.5.

Description:

Find pattern 'cat(<ADJ>) space lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -e 'cat(<ADJ>) space lexeme(dom)'

Output:

0000 01 W O lem:o,EXCL,P/Cal
0001 01 S _
0002 00 BOM * ser:1
0002 06 W Białym lem:biały,ADJ/CdDpNp,ADJ/CilDpGainpNs
0008 01 S _
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 00 EOM * ser:1
0013 01 S _
0014 04 W mówi lem:mówić,V/AiMdNsP3R-TfrVp
0018 01 S _
0019 03 W się lem:się,NPRO/CaZx,NPRO/CgZx
0022 01 P ,
0023 01 S _
0024 02 W że lem:żeTfrVp,CONJ;że,PART
0026 01 S _
0027 02 W to lem:toTfrVp,CONJ;to,NPRO/CaGnNsZd,NPRO/CnGnNsZd,PART;ten,ADJPRO/CanvGnNsZd
0029 01 S _
0030 04 W duży lem:duży,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0034 01 S _
0035 00 BOM * ser:2
0035 12 W funkcjonalny lem:funkcjonalny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0047 01 S _
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:2
0051 01 P .
0052 01 S \n

ser.6.

Description:

Find pattern 'cat(<ADJ>) space lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -m -e 'cat(<ADJ>) space lexeme(dom)'

Output:

0002 00 BOM * ser:1
0002 06 W Białym lem:biały,ADJ/CdDpNp,ADJ/CilDpGainpNs
0008 01 S _
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 00 EOM * ser:1
0035 00 BOM * ser:2
0035 12 W funkcjonalny lem:funkcjonalny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0047 01 S _
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:2

ser.7.

Description:

Find pattern '(cat(<ADJ>) space)+ lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -e '(cat(<ADJ>) space)+ lexeme(dom)'

Output:

0000 01 W O lem:o,EXCL,P/Cal
0001 01 S _
0002 00 BOM * ser:1
0002 06 W Białym lem:biały,ADJ/CdDpNp,ADJ/CilDpGainpNs
0008 01 S _
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 00 EOM * ser:1
0013 01 S _
0014 04 W mówi lem:mówić,V/AiMdNsP3R-TfrVp
0018 01 S _
0019 03 W się lem:się,NPRO/CaZx,NPRO/CgZx
0022 01 P ,
0023 01 S _
0024 02 W że lem:że,CONJ,PART
0026 01 S _
0027 02 W to lem:to,CONJ,NPRO/CaGnNsZd,NPRO/CnGnNsZd,PART;ten,ADJPRO/CanvGnNsZd
0029 01 S _
0030 00 BOM * ser:2
0030 04 W duży lem:duży,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0034 01 S _
0035 12 W funkcjonalny lem:funkcjonalny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0047 01 S _
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:2
0051 01 P .
0052 01 S \n

ser.8.

Description:

Find pattern '(cat(<ADJ>) space)+ lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -m -e '(cat(<ADJ>) space)+ lexeme(dom)'

Output:

0002 00 BOM * ser:1
0002 06 W Białym lem:biały,ADJ/CdDpNp,ADJ/CilDpGainpNs
0008 01 S _
0009 04 W Domu lem:dom,N/CgGiNs,N/ClGiNs,N/CvGiNs
0013 00 EOM * ser:1
0030 00 BOM * ser:2
0030 04 W duży lem:duży,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0034 01 S _
0035 12 W funkcjonalny lem:funkcjonalny,ADJ/CaDpGiNs,ADJ/CnvDpGaipNs
0047 01 S _
0048 03 W dom lem:dom,N/CaGiNs,N/CnGiNs
0051 00 EOM * ser:2

ser.9.

Description:

Find pattern 'cat(<ADJ>) space lexeme(dom)'. Mark beginning (BOM) and end (EOM) of each matching. Print the generated flex source code.

Command:

echo 'O Białym Domu mówi się, że to duży funkcjonalny dom.' | tok | lem -1 | ser -e 'cat(<ADJ>) space lexeme(dom)' --flex

Output:

%{
	#include<string.h>
	int n=0;
%}

%%

([ \t]*(([0-9]+[ \t]+)([0-9]+[ \t]+)?)?([^ \t\n\r\f]+)[ \t]+([^ \t\n\r\f]+)([ \t]+(([^ \t\n\r\f]+[ \t]+)*(lem:[^ \t\n\r\f]+,ADJ(\/([[:upper:]]+([[:lower:][:digit:]+?!*-]|<[^>\n[:cntrl:]]+>)+)*)?([,;][^ \t\n\r\f]+)?)([ \t]+[^ \t\n\r\f]+)*))[ \t]*\n)([ \t]*(([0-9]+[ \t]+)([0-9]+[ \t]+)?)?(S)[ \t]+([^ \t\n\r\f]+)(([ \t]+[^ \t\n\r\f]+)*)[ \t]*\n)([ \t]*(([0-9]+[ \t]+)([0-9]+[ \t]+)?)?([^ \t\n\r\f]+)[ \t]+([^ \t\n\r\f]+)([ \t]+(([^ \t\n\r\f]+[ \t]+)*(lem:([^ \t\n\r\f]+;)?dom,[^ \t\n\r\f]+)([ \t]+[^ \t\n\r\f]+)*))[ \t]*\n)			{
			  int start, end, len;
			  char *lastseg, *tmp;
			  if(yytext[yyleng-1]!='\n')
			    {fprintf(stderr,"ser: pattern matches incomplete line\n"); exit(1);}
			  n++;
			  sscanf(yytext,"%d %d",&start,&len);
			  yytext[yyleng-1]='\0';
			  if(tmp=strrchr(yytext,'\n'))
			  {
			    lastseg=tmp+1;
			    sscanf(lastseg,"%d %d", &end, &len);
			  }
			  else
			    end=start;
			  yytext[yyleng-1]='\n';
			  printf("%04d 00 BOM * ser:%s%d\n",start,"",n);
			  ECHO;
			  printf("%04d 00 EOM * ser:%s%d\n",end+len,"",n);
			}


.*\n			ECHO;

ser.10.

Description:

Find pattern '(cat(<N>) space cat(<ADJ>)) | (cat(<ADJ>) space cat(<N>))'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Panna młoda dostała sztuczne kwiaty i wieczne pióro. Rozpakowała wszystko na klatce schodowej.' | tok | lem -1 | ser -e '(cat(<N>) space cat(<ADJ>)) | (cat(<ADJ>) space cat(<N>))'

Output:

0000 00 BOM * ser:1
0000 05 W Panna lem:panna,N/CnGfNs
0005 01 S _
0006 05 W młoda lem:młoda,N/CnGfNs,N/CvGfNs;młody,ADJ/CanvDpGfNs
0011 00 EOM * ser:1
0011 01 S _
0012 07 W dostała lem:dostać,V/ApGfMdNsP3R?TaVp
0019 01 S _
0020 00 BOM * ser:2
0020 08 W sztuczne lem:sztuczny,ADJ/CanvDpGafinNp,ADJ/CanvDpGnNs
0028 01 S _
0029 06 W kwiaty lem:kwiat,N/CaGiNp,N/CnGiNp,N/CvGiNp
0035 00 EOM * ser:2
0035 01 S _
0036 01 W i lem:i,CONJ,EXCL
0037 01 S _
0038 00 BOM * ser:3
0038 07 W wieczne lem:wieczny,ADJ/CanvDpGafinNp,ADJ/CanvDpGnNs
0045 01 S _
0046 05 W pióro lem:pióro,N/CaGnNs,N/CnGnNs,N/CvGnNs
0051 00 EOM * ser:3
0051 01 P .
0052 01 S _
0053 11 W Rozpakowała lem:rozpakować,V/ApGfMdNsP3R-TaVp
0064 01 S _
0065 08 W wszystko lem:wszystko,NPRO/CaGnNsZg,NPRO/CnGnNsZg;wszystek,ADJPRO/CanvGnNsZg
0073 01 S _
0074 02 W na lem:na,P/Cal
0076 01 S _
0077 00 BOM * ser:4
0077 06 W klatce lem:klatka,N/CdGfNs,N/ClGfNs
0083 01 S _
0084 09 W schodowej lem:schodowy,ADJ/CdglDpGfNs
0093 00 EOM * ser:4
0093 01 P .
0094 01 S \n

ser.11.

Description:

Find pattern '(cat(<N>) space cat(<ADJ>)) | (cat(<ADJ>) space cat(<N>))'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Panna młoda dostała sztuczne kwiaty i wieczne pióro. Rozpakowała wszystko na klatce schodowej.' | tok | lem -1 | ser -m -e '(cat(<N>) space cat(<ADJ>)) | (cat(<ADJ>) space cat(<N>))'

Output:

0000 00 BOM * ser:1
0000 05 W Panna lem:panna,N/CnGfNs
0005 01 S _
0006 05 W młoda lem:młoda,N/CnGfNs,N/CvGfNs;młody,ADJ/CanvDpGfNs
0011 00 EOM * ser:1
0020 00 BOM * ser:2
0020 08 W sztuczne lem:sztuczny,ADJ/CanvDpGafinNp,ADJ/CanvDpGnNs
0028 01 S _
0029 06 W kwiaty lem:kwiat,N/CaGiNp,N/CnGiNp,N/CvGiNp
0035 00 EOM * ser:2
0038 00 BOM * ser:3
0038 07 W wieczne lem:wieczny,ADJ/CanvDpGafinNp,ADJ/CanvDpGnNs
0045 01 S _
0046 05 W pióro lem:pióro,N/CaGnNs,N/CnGnNs,N/CvGnNs
0051 00 EOM * ser:3
0077 00 BOM * ser:4
0077 06 W klatce lem:klatka,N/CdGfNs,N/ClGfNs
0083 01 S _
0084 09 W schodowej lem:schodowy,ADJ/CdglDpGfNs
0093 00 EOM * ser:4

ser.12.

Description:

Find pattern 'cat(<N>)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Kot, kota, kotu, kocie, kotem' | tok | lem -1 | ser -m -e 'cat(<N>)'

Output:

0000 00 BOM * ser:1
0000 03 W Kot lem:kota,N/CgGfNp;kot,N/CnGaNs
0003 00 EOM * ser:1
0005 00 BOM * ser:2
0005 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0009 00 EOM * ser:2
0011 00 BOM * ser:3
0011 04 W kotu lem:kot,N/CdGaNs
0015 00 EOM * ser:3
0017 00 BOM * ser:4
0017 05 W kocie lem:kota,N/CdGfNs,N/ClGfNs;kot,N/ClGaNs,N/CvGaNs
0022 00 EOM * ser:4
0024 00 BOM * ser:5
0024 05 W kotem lem:kot,N/CiGaNs
0029 00 EOM * ser:5

ser.13.

Description:

Find pattern 'cat(<N/Ci>)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Kot, kota, kotu, kocie, kotem' | tok | lem -1 | ser -m -e 'cat(<N/Ci>)'

Output:

0024 00 BOM * ser:1
0024 05 W kotem lem:kot,N/CiGaNs
0029 00 EOM * ser:1

ser.14.

Description:

Find pattern 'form(była)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Ala była tu, teraz jest tam.' | tok | lem -1 | ser -m -e 'form(była)'

Output:

0004 00 BOM * ser:1
0004 04 W była lem:były,ADJ/CanvDpGfNs;być,BYC/GfMdNsP3TaVp
0008 00 EOM * ser:1

ser.15.

Description:

Find pattern 'seg{3} word(teraz) seg{4}'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Ala była tu, teraz jest tam.' | tok | lem -1 | ser -m -e 'seg{3} word(teraz) seg{4}'

Output:

0009 00 BOM * ser:1
0009 02 W tu lem:tu,ADVPRO/Zd,PART
0011 01 P ,
0012 01 S _
0013 05 W teraz lem:teraz,ADV/Dp
0018 01 S _
0019 04 W jest lem:być,BYC/MdNsP3TfrVp
0023 01 S _
0024 03 W tam lem:tama,N/CgGfNp;tam,ADVPRO/Zd,ONO
0027 00 EOM * ser:1

ser.16.

Description:

Find pattern 'word space number punct number'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Czy 2+2 to cztery?' | tok | lem -1 | ser -m -e 'word space number punct number'

Output:

0000 00 BOM * ser:1
0000 03 W Czy lem:czy,CONJ,PART
0003 01 S _
0004 01 N 2
0005 01 P +
0006 01 N 2
0007 00 EOM * ser:1

grp

grp.1.

Description:

Select sentences containing an expression matching a pattern 'lexeme(kot)'.

Command:

echo 'Ala ma kota.' | tok | lem -1 | grp -e 'lexeme(kot)'

Output:

0000 03 W Ala
0003 01 S _
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 01 S _
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 01 P .
0012 01 S \n

grp.2.

Description:

Select sentences containing an expression matching a pattern 'lexeme(kot)'.

Command:

echo 'Ala ma psa.' | tok | lem -1 | grp -e 'lexeme(kot)'

Output:

 

mar

mar.1.

Description:

Match pattern 'lexeme(kot)'. Mark beginning (BOM) and end (EOM) of each matching.

Command:

echo 'Ala ma kota. Ola ma kota. Bartosz ma psa.' | tok | lem -1 | mar -e 'lexeme(kot)'

Output:

0000 03 W Ala
0003 01 S _
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 01 S _
0007 00 BOM *
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 00 EOM *
0011 01 P .
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 01 S _
0020 00 BOM *
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 00 EOM *
0024 01 P .
0025 01 S _
0026 07 W Bartosz lem:Bartosz,N/CnGpNs
0033 01 S _
0034 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0036 01 S _
0037 03 W psa lem:pies,N/CaGaNs,N/CgGaNs
0040 01 P .
0041 01 S \n

mar.2.

Description:

Match pattern 'lexeme(kot)'. Mark matching parts with MATCH tags (before and after any form of lexeme 'kot').

Command:

echo 'Ala ma kota. Ola ma kota. Bartosz ma psa.' | tok | lem -1 | mar -e '@MATCH lexeme(kot) @MATCH'

Output:

0000 03 W Ala
0003 01 S _
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 01 S _
0007 00 MATCH *
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 00 MATCH *
0011 01 P .
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 01 S _
0020 00 MATCH *
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 00 MATCH *
0024 01 P .
0025 01 S _
0026 07 W Bartosz lem:Bartosz,N/CnGpNs
0033 01 S _
0034 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0036 01 S _
0037 03 W psa lem:pies,N/CaGaNs,N/CgGaNs
0040 01 P .
0041 01 S \n

mar.3.

Description:

Match pattern 'lexeme(kot)'. Mark matching parts with BEGINMATCH tags (only before any form of lexeme 'kot').

Command:

echo 'Ala ma kota. Ola ma kota.' | tok | lem -1 | mar -e '@BEGINMATCH lexeme(kot)'

Output:

0000 03 W Ala
0003 01 S _
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 01 S _
0007 00 BEGINMATCH *
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 01 P .
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 01 S _
0020 00 BEGINMATCH *
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 01 P .
0025 01 S \n

mar.4.

Description:

Match pattern 'lexeme(kot)'. Mark matching parts with ENDMATCH tags (only after any form of lexeme 'kot').

Command:

echo 'Ala ma kota. Ola ma kota.' | tok | lem -1 | mar -e 'lexeme(kot) @ENDMATCH'

Output:

0000 03 W Ala
0003 01 S _
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 01 S _
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 00 ENDMATCH *
0011 01 P .
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 01 S _
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 00 ENDMATCH *
0024 01 P .
0025 01 S \n

mar.5.

Description:

Match pattern 'word(ma) space lexeme(kot)'. Mark matching parts with MA (before and after each word 'ma') and KOT (before and after any form of lexeme 'kot') tags.

Command:

echo 'Ala ma kota. Ola ma kota.' | tok | lem -1 | mar -e '@MA word(ma) @MA space @KOT lexeme(kot) @KOT'

Output:

0000 03 W Ala
0003 01 S _
0004 00 MA *
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 00 MA *
0006 01 S _
0007 00 KOT *
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 00 KOT *
0011 01 P .
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 00 MA *
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 00 MA *
0019 01 S _
0020 00 KOT *
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 00 KOT *
0024 01 P .
0025 01 S \n

mar.6.

Description:

Match pattern 'word(ma) space lexeme(kot)'. Mark matching parts with MA (before and after each word 'ma'), KOT (before and after any form of lexeme 'kot'), BEGINMATCH, ENDMATCH (before and after each matching) tags.

Command:

echo 'Ala ma kota. Ola ma kota.' | tok | lem -1 | mar -e '@BEGINMATCH @MA word(ma) @MA space @KOT lexeme(kot) @KOT @ENDMATCH'

Output:

0000 03 W Ala
0003 01 S _
0004 0004 00 BEGINMATCH *
0004 00 MA *
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 00 MA *
0006 01 S _
0007 00 KOT *
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 00 KOT *
0011 00 ENDMATCH *
0011 01 P .
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 0017 00 BEGINMATCH *
0017 00 MA *
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 00 MA *
0019 01 S _
0020 00 KOT *
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 00 KOT *
0024 00 ENDMATCH *
0024 01 P .
0025 01 S \n

kot

kot.1.

Description:

Change raw text into list of tokens.

Command:

echo 'Ala ma kota.' | tok

Output:

0000 03 W Ala
0003 01 S _
0004 02 W ma
0006 01 S _
0007 04 W kota
0011 01 P .
0012 01 S \n

kot.2.

Description:

Change list of tokens into raw text.

Command:

echo 'Ala ma kota.' | tok | kot

Output:

Ala ma kota.

kot.3.

Description:

Change list of tokens into raw text. Retain the special characters.

Command:

echo 'Ala ma kota.' | tok | kot -r

Output:

Ala_ma_kota.\n

kot.4.

Description:

Change list of tokens into raw text.

Command:

echo 'Panna młoda dostała sztuczne kwiaty i wieczne pióro. Rozpakowała wszystko na klatce schodowej.' | tok | lem -1 | ser -m -e '(cat(<N>) space cat(<ADJ>)) | (cat(<ADJ>) space cat(<N>))' | kot

Output:

Panna młoda
-----
sztuczne kwiaty
-----
wieczne pióro
-----
klatce schodowej

fla

fla.1.

Description:

'Flatten' a utt file by merging segments belonging to one sentence in one line.

Command:

echo 'Ala ma kota. Ola ma kota. Paweł też ma.' | tok | sen | lem -1 | grp -e 'lexeme(kot)' | fla

Output:

0000 00 BOS *
             0000 03 W Ala
                          0003 01 S _
                                     0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
                 0006 01 S _
                            0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
  0011 01 P .
             0012 00 EOS *
0012 00 BOS *
             0012 01 S _
                        0013 03 W Ola
                                     0016 01 S _
                                                0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
                            0019 01 S _
                                       0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
             0024 01 P .
                        0025 00 EOS *

unfla

unfla.1.

Description:

Transform a flattened UTT file into the regular format by restoring end-of-line characters.

Command:

echo 'Ala ma kota. Ola ma kota. Paweł też ma.' | tok | sen | lem -1 | fla | unfla

Output:

0000 00 BOS *
0000 03 W Ala
0003 01 S _
0004 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0006 01 S _
0007 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0011 01 P .
0012 00 EOS *
0012 00 BOS *
0012 01 S _
0013 03 W Ola
0016 01 S _
0017 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0019 01 S _
0020 04 W kota lem:kota,N/CnGfNs;kot,N/CaGaNs,N/CgGaNs
0024 01 P .
0025 00 EOS *
0025 00 BOS *
0025 01 S _
0026 05 W Paweł
0031 01 S _
0032 03 W też lem:też,CONJ,PART
0035 01 S _
0036 02 W ma lem:mieć,V/AiMdNsP3R?TfrVp;mój,ADJPRO/CnvGfNsZs
0038 01 P .
0039 01 S \n
0040 00 EOS *

help

help.1.

Description:

Print tok help.

Command:

tok -h

Output:

tok 0.1

Usage: tok [OPTIONS]...

  -h, --help         Print help and exit
  -V, --version      Print version and exit
  -i, --interactive  Interactive mode.  (default=off)

help.2.

Description:

Print lem help.

Command:

lem -h

Output:

lem 0.1

Usage: lem [OPTIONS]...

  -h, --help                    Print help and exit
      --full-help               Print help, including hidden options, and exit
  -V, --version                 Print version and exit
...

help.3.

Description:

Print gue help.

Command:

gue -h

Output:

guess 0.1

Usage: guess [OPTIONS]...

  -h, --help                    Print help and exit
      --full-help               Print help, including hidden options, and exit
  -V, --version                 Print version and exit
...

version

version.1.

Description:

Print tok version information.

Command:

tok -V

Output:

tok 0.1

version.2.

Description:

Print lem version information.

Command:

lem -V

Output:

lem 0.1

version.3.

Description:

Print gue version information.

Command:

gue -V

Output:

guess 0.1
Last modified 12 years ago Last modified on 02/22/12 08:44:11