OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Citation extractors have problem with hyphenated first name

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Citation extractors have problem with hyphenated first name

Postby newbies » Tue Feb 18, 2014 11:17 am

If there is an author with a hyphenated first name, citation extractors will discard the part of the name after the hyphen, for example, this name Szu-Chuan Hsieh should appear as Hsieh SC, but the extractors regard Hsieh S as correct.

Original Citation Text:
Sigdel TK, Vitalone MJ, Tran TQ, Dai H, Hsieh SC et al. (2013) A rapid noninvasive assay for the detection of renal transplant injury. Transplantation 96: 97-101.


Citation Export Preview (Vancouver Citation Output):
Sigdel TK, Vitalone MJ, Tran TQ, Dai H, Hsieh S, et al. (2013) A rapid noninvasive assay for the detection of renal transplant injury.. Transplantation 96: 97-101. doi: 10.1097/TP.0b013e318295ee5a. [View Article] [PubMed]


How can I know which extractor may have caused this error and how to fix it?

thank you for your attention to this glitch.
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: Citation extractors have problem with hyphenated first n

Postby asmecher » Tue Feb 18, 2014 12:10 pm

Hi newbies,

The following classes (at least) make assumptions about how to form initials, and are implemented by taking the first letter of the last name:
  • lib/pkp/plugins/citationLookup/pubmed/filter/PubmedNlm30CitationSchemaFilter.inc.php
  • lib/pkp/plugins/metadata/nlm30/filter/Nlm30CitationSchemaOpenurl10CrosswalkFilter.inc.php
  • lib/pkp/plugins/metadata/nlm30/filter/Nlm30NameSchemaPersonStringFilter.inc.php
Look for "String::substr" in each of these files. I'd suggest adding an error_log entry to identify which case in particular you're invoking, and then writing a smarter function to get initials, invoking it from each of the 3 places above instead of duplicating it each time.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Citation extractors have problem with hyphenated first n

Postby newbies » Tue Feb 18, 2014 7:10 pm

Thanks Alec,

I have identified the code in the files you gave, but I am not good at PHP and won't be able to modify.

1st file:
Code: Select all
$givenNames = $firstAuthor->getStatement('given-names');
                  if (is_array($givenNames)) $searchTerms .= ' '.String::substr($givenNames[0], 0, 1);
               } else {
                  $searchTerms .= $citationDescription->getStatement($nlm30Property);
               }

2nd file:
Code: Select all
foreach($givenNames as $givenName) {
               $initials[] = substr($givenName, 0, 1);
            }


3rd file
Code: Select all
foreach($givenNames as $givenName) {
            $nameVars['%initials%'] .= String::substr($givenName, 0, 1).'.';
         }
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: Citation extractors have problem with hyphenated first n

Postby newbies » Thu Feb 20, 2014 5:59 pm

Can anyone contribute a snip of php code to deal with hyphenated first name? thank you in advance.
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: Citation extractors have problem with hyphenated first n

Postby newbies » Tue Jul 22, 2014 11:43 pm

i still need to modify the code to correct the missing letter in first name. This problem also occurs to citation export.

Here is a piece of code in the citationFormat tpl file

Code: Select all
{$firstName|escape|truncate:1:"":true}


Can anyone help modify the code to allow it to extract first name "Zong-Tong" into "ZT" instead of "Z"?

Thank you.
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: Citation extractors have problem with hyphenated first n

Postby asmecher » Wed Mar 11, 2015 9:20 am

(See http://forum.pkp.sfu.ca/t/citation-extr ... st-name/88 for a continuation of this thread.)
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 3 guests