@@ -164,8 +164,6 @@ function process(){
164
164
parent ::QQuadO_URL ($ gb_res , $ this ->getVoc ().'fasta-seq ' , 'https://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?sendto=on&db=nucest&dopt=fasta&val= ' .$ parsed_version_arr ['gi ' ])
165
165
);
166
166
167
-
168
-
169
167
foreach ($ parsed_accession_arr [0 ] as $ acc ){
170
168
parent ::AddRDF (
171
169
parent ::triplifyString ($ gb_res , $ this ->getVoc ()."accession " , $ acc )
@@ -235,13 +233,29 @@ function process(){
235
233
*/
236
234
function parseFeatures ($ feature_arr ){
237
235
$ rm = array ();
236
+ //get a copy of the features array
237
+ $ features = $ this ->getFeatures ();
238
+ $ feat_keys = array_keys ($ features );
238
239
foreach ($ feature_arr as $ feat ){
239
240
$ feature_raw = utf8_encode (trim ($ feat ['value ' ]));
241
+ echo "\n\n" .$ feature_raw ."\n\n" ;
242
+
243
+ $ arr = explode ("\n" , $ feature_raw );
244
+ print_r ($ arr );exit ;
240
245
if (strlen ($ feature_raw )){
241
246
//remove multiple spaces and newlines
242
247
$ feature_raw = preg_replace ('/\s\s*/ ' , ' ' , $ feature_raw );
243
- print_r ($ feature_raw );
244
- echo "\n*** \n" ;
248
+ //now construct a regex for every section
249
+ $ regex_string = "(.*) " ;
250
+ $ regex_groups = array ();
251
+ foreach ($ feat_keys as $ aKey ){
252
+ if (strpos ($ feature_raw , $ aKey )){
253
+ $ regex_string .= "\s+ " .$ aKey ."\s+(.*) " ;
254
+ $ regex_groups [] = $ aKey ;
255
+ }
256
+ }//foreach
257
+ $ regex = "/ " .$ regex_string ."/ " ;
258
+ echo "\n" .$ feature_raw ."\n" .$ regex ."\n" ;exit ;
245
259
}
246
260
}
247
261
return $ rm ;
0 commit comments