Skip to content

Commit

Permalink
extend CHEMIC rules and integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
prohippo committed Nov 8, 2018
1 parent 8142891 commit e90c691
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 1 deletion.
29 changes: 28 additions & 1 deletion applcn/chemic.g.elly
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# parsing of chemical names in text
# chemical.g.elly
# chemic.g.elly

#
# basic parsing
Expand Down Expand Up @@ -113,6 +113,33 @@ __
g:CHEM->RNGX CHEM
__

g:LOCN->LOCN QUAL
__

p:prej
_
left
delete 1 >
split
right
back
var ch=
extract ch <
if ~ch=+
insert < ch
end
merge
__

g:CHEM->PRFX CHEM
_
(prej)
__
g:CHEM->PRFX UNKN
_
(prej)
__

#
# for locant structural description

Expand Down
4 changes: 4 additions & 0 deletions applcn/chemic.p.elly
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
0 !$ ATOM -1

0 -#$ ATID -1

0 (#!) QUAL -1

0 &@+ PRFX -1
6 changes: 6 additions & 0 deletions applcn/chemic.ptl.elly
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# parsing of chemical names in text
# chemic.ptl.elly

thio 1 0 .
+per 1 0 .
+oxy 1 0 .
2 changes: 2 additions & 0 deletions applcn/chemic.stl.elly
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ diene 1 0 0
ethyl 1 0 0
indene 1 0 0
methyl 1 0 0
one 1 0 0
oxide 1 0 0
sulfate 1 0 0
sulfide 1 0 0
thioic 1 0 0

naphthalene 1 0 0
3 changes: 3 additions & 0 deletions applcn/chemic.v.elly
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ acet : ROOT
chloro : ROOT
dimethano : ROOT
methano : ROOT
naphthalen : ROOT
propa : ROOT

acetate : CHEM
acetic : CHEM
acid : CHEM
benzene : CHEM
butane : CHEM
chloride : CHEM
diphosphoric : CHEM
ethyl : CHEM
heptane : CHEM
idene : CHEM
Expand Down
3 changes: 3 additions & 0 deletions chemic.main.key
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
uu 〖bicyclo[3.2.0]heptane〗!
uu 〖benzo[1′′,2′′:3,4;5′′,4′′:3′,4′]dicyclobuta[1,2-a:1′,2′-a′]diindene〗!
uu 〖4-(2-naphthalenyl)-benzoic acid〗!
zzz 〖butane (dithioic) acid〗!
zzz 〖1(2h)-naphthalenone〗!
zzz 〖thioperoxydiphosphoric acid〗!
3 changes: 3 additions & 0 deletions chemic.main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ uu N-2-naphthalenyl-acetamide !
uu bicyclo[3.2.0]heptane !
uu benzo[1′′,2′′:3,4;5′′,4′′:3′,4′]dicyclobuta[1,2-a:1′,2′-a′]diindene !
uu 4-(2-naphthalenyl)-benzoic acid !
zzz butane(dithioic) acid !
zzz 1(2H)-naphthalenone !
zzz thioperoxydiphosphoric acid !

0 comments on commit e90c691

Please sign in to comment.