Permalink
Browse files

Извлекаем даты фильма, если она стоит после названия

  • Loading branch information...
alkozko committed Oct 30, 2017
1 parent 5877e11 commit 48467d275e0ce293dd62af86c57c6501c1bc0673
Showing with 21 additions and 4 deletions.
  1. +7 −0 dates.cxx
  2. +1 −0 facttypes.proto
  3. +8 −4 film.cxx
  4. +5 −0 mydic.gzt
@@ -0,0 +1,7 @@
#encoding "utf-8"
#GRAMMAR_ROOT S

Date -> Word<wff="(19[0-9]{2})|(20[0-2][0-9])">;
Descr -> 'год';

S -> Date Descr;
@@ -6,4 +6,5 @@ message Film: NFactType.TFact
required string Name = 1;
optional string Genre = 2;
optional string Director = 3;
optional string Date = 4;
}
@@ -1,6 +1,9 @@
#encoding "utf-8"
#GRAMMAR_ROOT S

//Даты
Date -> AnyWord<kwtype="даты">;

Title -> Word<h-reg1, quoted>;
Title -> Word<h-reg1, l-quoted, ~r-quoted> Word<~l-quoted, r-quoted>;
Title -> Word<h-reg1, l-quoted, ~r-quoted> AnyWord<~r-quoted>+ Word<~l-quoted, r-quoted>;
@@ -9,11 +12,12 @@ GenreDescr -> Word<kwtype="жанр"> | Word<wff=/фильм-.+/> | Adj "фил
Genre -> Adj* GenreDescr;
FilmDescriptor -> Genre interp(Film.Genre) | "фильм";

Name -> Word<h-reg1, ~fw, nc-agr[1]> Word<h-reg1, nc-agr[1]>*;
Director -> Name<gram="род"> interp (Film.Director);

FilmTitle -> Title interp(Film.Name::not_norm);
FilmTitle -> FilmTitle "и" FilmTitle;

S -> FilmTitle Hyphen* FilmDescriptor;
Name -> Word<h-reg1, ~fw, nc-agr[1]> Word<h-reg1, nc-agr[1]>*;

Director -> Name<gram="род"> interp (Film.Director);

S -> FilmTitle Hyphen* FilmDescriptor (Date interp (Film.Date));
S -> FilmDescriptor (Director) FilmTitle;
@@ -14,4 +14,9 @@ TAuxDicArticle "жанр"
TAuxDicArticle "фильм"
{
key = { "tomita:film.cxx" type=CUSTOM }
}

TAuxDicArticle "даты"
{
key = { "tomita:dates.cxx" type=CUSTOM }
}

0 comments on commit 48467d2

Please sign in to comment.