Jump to content

Parsing a citation


wescrock

Recommended Posts

Hey all,

 

My department at a university library has taken on a project (passed to us by the Smithsonian Nat. Museum) in which I will be developing a front end for a database. We are currently rebuilding the DB, but would like to make a view where we take a citation field [i.e. below] and parse it to separate each section of it [date, author, publisher... they SHOULD all be in ALA format.]

 

I am coming here with this, because I am very new to PHP and have never done something like this...

 

Citation Example:

 

Ahlström, Göran.<i> Technological Development and Industrial Expositions, 1850-1914: Sweden in an International Perspective.</i> Lund: Lund University Press, 1996.

 

 

My main concern with this kind of parsing, is that the format of these citations are not comma delineated or anything of the sort.

 

I need to make a view that will show the citation broken into sections (author, article, date, publisher...) eventually, this same piece of code will be used to insert into the new table that is being created at a later date.

 

If anyone could give me some guidance, that would be fantastic.

 

Thank you,

Wes Crockett

 

Link to comment
https://forums.phpfreaks.com/topic/123633-parsing-a-citation/
Share on other sites

I need to make a view that will show the citation broken into sections (author, article, date, publisher...) eventually, this same piece of code will be used to insert into the new table that is being created at a later date.

 

The only way I can see that you can do this is to have a separate text input field for each piece of information that makes up a citation (author, article, date, publisher) and have coresponding database fields.

 

it would be almost impossible for a php script to take one text string typed in by a user and split it into the above parts unless you could somehow guarantee that the info would be delimited in some way (like comas or hyphens) or were always true to a an exact pattern that php could test against.

Link to comment
https://forums.phpfreaks.com/topic/123633-parsing-a-citation/#findComment-638433
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.