Skip to content

Commit

Permalink
Merge pull request #367 from kyaushev/master
Browse files Browse the repository at this point in the history
Алгоритм распознавания группового экранирования предложений (#341)
  • Loading branch information
Mazdaywik authored Nov 4, 2023
2 parents 87d1478 + 7e6e81f commit 93cbd7a
Show file tree
Hide file tree
Showing 25 changed files with 1,607 additions and 8 deletions.
22 changes: 22 additions & 0 deletions autotests/multiscreening-ADT.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
* WARNING multiscreening

$ENTRY Go {
= ;
}

$ENUM ErrorList;

ADT-Test {
[ErrorList (e.FileName) (e._) (e.Warnings)] e._
= EL-HasErrors;

t.ErrorList e._ = EL-HasErrors;

[ErrorList (e.FileName) () (e._ (s.WarningId e._) e._)]
e._
s.WarningId
e._
= EL-HasErrors;
t.ADT e._ = /* пусто */;
}

16 changes: 16 additions & 0 deletions autotests/multiscreening-assign.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* WARNING multiscreening

$ENTRY Go {
= <Test>
}

Test {
/* empty */
= {
'I' e.Var 'd' = 0;
e.Var = 1;
'I am screened' = 2;
}
: e.Var
= e.Var;
}
15 changes: 15 additions & 0 deletions autotests/multiscreening-assign.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* NO-WARNINGS

$ENTRY Go {
= <AssignTest 'b' A 'abc'>
}

AssignTest {
e.X A e.Y
= e.X : e.F
= {
e.Y = e.Y;
e.F = e.X;
'I am not screened' = e.Y
};
}
19 changes: 19 additions & 0 deletions autotests/multiscreening-blocks.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
* WARNING multiscreening

$ENTRY Go {
= <BracketsInPatternTest (('a'))>
}

BracketsInPatternTest {
s.X = True;
(('a'))
= 'a'
: {
t.x = 1;
s.x = 2;
'a' = 3;
'A' = 4;
'a' = 5;
};
e.Y = False;
}
11 changes: 11 additions & 0 deletions autotests/multiscreening-brackets-in-pattern.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* WARNING multiscreening

$ENTRY Go {
= <BracketsInPatternTest ('b')>
}

BracketsInPatternTest {
(t.X) = True;
((s.X)) = True;
(('a')) = False;
}
11 changes: 11 additions & 0 deletions autotests/multiscreening-brackets.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* WARNING multiscreening

$ENTRY Go {
= <F A (B C D)>
}

F {
e.X t.Y (t.Z e.K) = 1;
e.Y (e.Z) = 2;
A e.Q (B C D) = 3;
}
10 changes: 10 additions & 0 deletions autotests/multiscreening-closure.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* WARNING multiscreening

$ENTRY Go {
= <BracketsClosureTest 'b'>
}

BracketsClosureTest {
'a' = 0;
s.X = ({e.Y = 1; s.x = 2});
}
15 changes: 15 additions & 0 deletions autotests/multiscreening-condition.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* NO-WARNINGS

$ENTRY Go {
= <ShellTest 'unix'>
}

GetEnv {
e._ = '/zsh';
}

ShellTest {
'unix', <GetEnv 'SHELL'> : e.path '/tcsh' = Tcsh;

'unix' = Bash;
}
23 changes: 23 additions & 0 deletions autotests/multiscreening-e-vars.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* WARNING multiscreening

$ENTRY GO {
= ;
}

EVarsTest1 {
e.0 = 0;
e.1 e.2 e.3 e.4 (e.5) = 1;
}

EVarsTest2 {
e.0 e.1 e.2 e.3 e.4 = 0;
(e.5) = 1;
}

EVarsTest3 {
e.1 A e.2
= {
e.3 = e.1;
'I am screened' = e.2
};
}
72 changes: 72 additions & 0 deletions autotests/multiscreening-e-vars.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
* NO-WARNINGS

$ENTRY Go {
= ;
}

EVarsTest1 {
e.X s.Y = True;
s.Y e.X = False
}

EVarsTest2 {
(e.shift) e.shift e.blanks = ;
(e.shift) e.blanks = ;
}

EVarsTest2s {
e.shift
= {
e.shift e.blanks = ;
e.blanks = ;
}
}

EVarsTest3 {
(e.shift) (e.shift e.blanks) = ;
(e.shift) (e.blanks) = ;
}

EVarsTest4 {
(e.X1 t.1)(e.X2 t.1) = ;
(t.1 e.X1)(t.1 e.X2) = ;
}

EVarsTest5 {
t.A t.A e.B = 1;
t.A t._ e._ = 2;
}

EVarsTest6 {
(t.1 e.1)(t.1 e.2) = 1;
(e.1 t.1)(e.2 t.1) = 2;
}

EVarsTest7 {
(t.1 e.1)(t.1 e.1) = 1;
(e.2 t.2)(e.2 t.2) = 2;
}

EVarsTest8 {
(e.value':'(Var s.t s.i e.elevi)) (e.value1':'(Var s.t s.i e.elevj)) e.assign
= (e.value':'(Var s.t s.i e.elevi)) e.assign;
t.assigni t.assignj e.assign = t.assignj <EVarsTest8 t.assigni e.assign>;
t.assigni = t.assigni;
}

EVarsTest9 {
(Output t.restr ((Expectant)':'t.var)) t.out-var = ;
(Output t.restr ((No)':'t.var)) t.out-var = ;
(Output t.restr (e.out-expr ':'t.var)) t.out-var = ;
(Output t.restr (e.out-expr ':'t.var)) = ;
(Basic e.basic (Output t.restr ((Expectant)':'t.var)) ':' t.out-var) = ;
(Basic e.basic (Output t.restr ((No)':'t.var)) ':' t.out-var) = ;
(Basic e.basic (Output t.restr (e.out-expr':'t.var)) ':' t.out-var),
<EVarsTest9 <EVarsTest9 Of Expr e.out-expr>>: e.assign = ;
}

EVarsTest10 {
(Recur t.basics) t.dict s.global (s.type e.n-graph) t.outfmt = ;
(Recur t.basics t.finish) t.dict s.global (s.type e.n-graph) t.outfmt =;
}

15 changes: 15 additions & 0 deletions autotests/multiscreening-floating-t-var.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* WARNING multiscreening

$ENTRY Go {
= ;
}

FLoatingTVarTest1 {
e.X1 t.Y1 = 1;
t.X2 e.Y2 = 2;
}

FLoatingTVarTest2 {
t.X1 e.Y1 = 1;
e.X2 t.Y2 = 2;
}
20 changes: 20 additions & 0 deletions autotests/multiscreening-repeated-vars.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
* WARNING multiscreening

$ENTRY GO {
= ;
}

RepeatedVarsConditions {
s.1 (e.2) (s.3) (e.4) = 0;
s.1 (e.2) t.3 t.4 = 1;
s.1 (e.2) (s.1) (e.2), s.1 : 'A' = 2;
}

Eq {
t.X t.Y
, t.X
: {
t.Y^ = True;
t.Y = False;
}
}
29 changes: 29 additions & 0 deletions autotests/multiscreening-repeated-vars.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
* NO-WARNINGS

$ENTRY GO {
= ;
}

/*RepeatedVars {
s.1 (e.2) (s.1) (e.2) = 0;
s.1 (e.2) (s.1) (e.2) = 1;
}*/


Eq1 {
t.X t.Y
, t.X
: {
t.Y = True;
t.Other = False;
}
}

Eq2 {
t.X t.Y
, t.X
: {
t.Y = True;
t.Y^ = False;
}
}
27 changes: 27 additions & 0 deletions autotests/multiscreening.WARNING.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
* WARNING multiscreening

$ENUM Apply;

$ENTRY Go {
= ;
}

TestScreening1 {
e.x 'A' = 1;
e.x t.1 t.2 t.3 e.y = 2;
'A' t.1 = 3;
'A' e.x = 4;
}

TestScreening2 {
t.1 t.2 e.3 = One;
e.X t.Y = Two;
/* пусто */ = Three;
e.X = "Boom!";
}

Map {
t.Fn t.Next e.Tail = <Apply t.Fn t.Next> <Map t.Fn e.Tail>;
t.Fn /* пусто */ = /* пусто */;
t.FUNC e.items = <Map t.FUNC e.items>;
}
Loading

0 comments on commit 93cbd7a

Please sign in to comment.