I have two projects this semester that are turning out to be more alike than I expected. One has a concordance built from transcripts of manuscripts. The other is putting together a map-based browser for a set of documents.
I’ve already done some work on the concordance front. I can compile a list of words, their frequencies, and which locations they appear in. It’s just a matter of tacking on a browsing interface to the data and I have a fairly full-blown concordance. I also need to finish the transcription browser, but that’s coming along as well built on the AJAX pager plugin to jQuery.
The map-based browser needs to be able to associate places with documents, but more importantly, documents with places. I can also, now, walk through a set of documents with locations tagged, pull out those locations, and attach a latitude and longitude. All I need to be able to do now is take two sets of codings and consolidate them while preserving the document location annotations.
The two processes are nearly identical, so the code should be nearly identical as well. My goal today is to get all of the different pieces in the Fabulator engine environment in place so both processes work as expected. This will likely introduce a new function ‘consolidate’ that does for a collection of nodes what ‘sum’ does with numbers.
Consolidation of two nodes happens when the nodes are considered equal except for any accompanying annotations (attributes or children that are not themselves part of the value of the node as determined by the node type). The two nodes are combined (for example, concordance word nodes have their counts summed) and attributes and children are combined, allowing location annotations to bubble up through the consolidations and remain in the overall concordance or database.