#!/usr/bin/env icarus
# DSMZ Phages Catalogue - Syntax file
# Version 2004.12.17.01
# Last Updated December 17, 2004
# Author: Domenico Marra & Francesca Piersigilli & Paolo Romano
# (c) CABRI 1999-2023
$fn={
Name:name
Collection_number:coll_no
Type:type
Other_collection_numbers:other_nos
Literature:literature
History_of_deposit:history
Restricted_distribution:rest_dist
Host_for_propagation:host_for_prop
Host_used_for_propagation:host_str
Lysogenicity:lyso
Virus_used_for:virus_used_for
Medium:medium
Class:class
Viral_morphology:vimor
Plaque_description:plade
Further_information:further_inf
Restriction_sites:rest_sites
}
$rules={
entry: ~ {$In:[file:text] $Out pre $Skip:0}
('Collection_number' {$Not} ln)*
('Collection_number' {$entryFip=$Fip $Wrt} ln {$App}
('Collection_number' {$Not} ln {$App})*)?
~
# fields
fields: ~ {$In:entry $Out $Skip:1}
(/\/[^\n]+\n/ {$Wrt} |
word {$Wrt:$fn.$Ct}
(/[\/A-Z]/ {$Not} ln {$App})+)+ ~
#indexing
coll_no: ~ {$In:[fields c:coll_no] $Out}
word ' ' (word2{$Wrt} |punct2)* ~
name: ~ {$In:[fields c:name] $Out}
word (word{$Wrt} |punct)* ~
strX: ~ {$In:[fields c:{type rest_dist literature history
host_for_prop host_str lyso virus_used_for
class vimor
plade further_inf
rest_sites}] $Out}
word (str{$Uniq:$Itc}| /./ |punct)* ~
medium: ~ {$In:[fields c:medium] $Out}
word ' '* (word{$Wrt} |punct)* ~
other_nos: ~ {$In:[fields c:other_nos] $Out}
word / /? (word2{$Uniq} | /; /)* ~
#HTML stuff...
h_top: ~ {$In:[fields c:coll_no t:html] pre if:$ParInt:isTable $Fail}
word {$Rep:
|</TR><TR VALIGN=TOP>
|<TD colspan=2 bgcolor=\"#ffffff\">
|<font color=\"#000066\">
|<B>CABRI:($entry.libName)</B></TD>
|</TR>
|<TR VALIGN=TOP><TD bgcolor=\"#ffffff\">
|<font color=\"#000066\"><b><i>$Ct</i></b></font></TD>
|<TD bgcolor=\"#ffffff\">
}
':'? {$Rep:""} /.*/ {$Rep:"$Ct</TD></TR>"} ~
h_medium: ~ {$In:[fields c:medium t:html] pre if:$ParInt:isTable $Fail}
'Medium' {if:$isTable==0
$Rep:
|<TR VALIGN=TOP><TD bgcolor=\"#ffffff\">
|<font color=\"#000066\"><b><i>$Ct</i></b></font></TD>
|<TD bgcolor=\"#ffffff\">
}
' '* word {$rest=$Ct.rep:[' ' to:'%20']
$Rep:$Hlink:[dsmz_mediaR p:{$rest $Ct}]} ~
h_fields: ~ {$In:[fields t:html] pre if:$ParInt:isTable $Fail}
word {if:$isTable==0
$Rep:
|<TR VALIGN=TOP><TD bgcolor=\"#ffffff\">
|<font color=\"#000066\"><b><i>$Ct</i></b></font></TD>
|<TD bgcolor=\"#ffffff\">
} ':'? {$Rep:""} /.*/ {$Rep:"$Ct</TD></TR>"} ~
t_fields: ~ {$In:[fields] $Out} tag /.*/ {$Wrt:$Itc} ~
# definitions
tag: ~ word ':'?~
ln: ~/[^\n]*\n/ ~
word: ~/[0-9a-zA-Z_\/-]+/ ~
word2: ~/[ 0-9a-zA-Z_\\.\\(\\)\/\\+-]+/ ~
str: ~/[a-zA-Z0-9&.'=\/\\%_-]+/ ~
punct: ~ /[ \t,;:\\.\\(\\)\\+\\*]+/ ~
punct2: ~ /[\t,;:\/\\+]+/ ~
}