{ "info": { "author": "Adam Fourney", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "pyra - Python Region Algebra\n============================\n\n\nPyra is a python implementation of the region algebra and query language described in [1]. \nRegion algebras are used to efficiently query semi-structured text documents. This particular\nregion algebra operates on Generalized Concordance Lists (GCLs). GCLs are lists of regions\n(a.k.a., extents), which obey the following constraint: *No region in the list may have another\nregion from the same lists nested within it*. For a quick online introduction to this region\nalgebra, and why it is useful, visit:\n\n[Wumpus Search](http://www.wumpus-search.org/docs/gcl.html) \n\nIn general, this region algebra is good for extracting data from documents that have lightweight\nstructure, and is an alternative to more heavyweight solutions like XPath queries.\n\n\n### Algebra and Query Language\n\nOur region algebra consists of the following elements:\n\n(Essentially identical to the conventions used in Wumpus [See above])\n\n Elementary Types\n \u2014---------------\n \"token\" Tokens are quoted strings. Use \\\" to escape quotes, and \\\\ to escape escapes\n \"a\", \"b\", \"c\" Phrases are comma separated tokens\n INT Positions are indicated as bare integers (e.g., 4071)\n\n Operators (here A and B are arbitrary region algebra expressions, N is an integer)\n ----------------------------------------------------------------------------------\n A ^ B Returns all extents that match both A and B\n A + B Returns all extents that match either A or B (or both)\n A .. B Returns all extents that start with A and end with B\n A > B Returns all extents that match A and contain an extent matching B \n A < B Returns all extents that match A, contained in an extent matching B\n\n _{A} The 'start' projection. For each extent (u,v) in A, return (u,u)\n {A}_ The 'end' projection. For each extent (u,v) in A, return (v,v)\n\n [N] Returns all extents of length N, where N is an integer (basically a sliding window)\n\n Not yet implemented:\n A /> B Returns all extents that match A but do not contain an extent matching B\n A /< B Returns all extents that match A, not contained in an extent matching B\n\n\n### Examples\n\nSuppose we an XML document containing the complete works of Shakespeare (see './pyra/examples').\nWe can then run the following queries using pyra:\n\n**Return the titles of all plays, acts, scenes, etc.**\n\n \"