% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % File: all.dtr % % Purpose: provide support for multiple value queries % % Author: Roger Evans, 4 August 1993 % % Email: Roger.Evans@itri.bton.ac.uk % % Address: ITRI, Univ. Brighton, Lewes Road, Brighton BN2 4GJ, UK % % Related files: polysemy.dtr % % Version: 1.01 % % % % Copyright (c) University of Sussex 1993. All rights reserved. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % The node ALL provides support for returning all the results % represented in a DATR theory that implements multiple values using % path-prefixing (like Kilgarriff's use of ). % % It should be used as follows. In the basic definition, encode % multiple values for a path by prefixing successive values % with , e.g.: % % NODE: == value_1 % == value_2 % == value_3. % % On its own, this is a reasonable description in DATR, but it's hard % to get hold of ALL the values of - you need a bit of external % querying code. This file provides such code in DATR itself (n.b.: it % is probably best to think of this as external to the main % description, rather than actually part of it, since it uses % techniques you probably don't need elsewhere). You simply add: % % NODE: <> == undef % == ALL:<>. % % and then you will find that by prefixing to query paths, all % the defined values for the path will be returned (as a sequence): % % NODE: = value_1 value_2 value_3. % % Note that the <> == undef case might be pushed up to the top of % the inheritance hierarchy - as long as otherwise-undefined values % get the value 'undef' from somewhere, it will work. % % The definition also allows you to specify that certain paths are % or are not functional, that is they only have one value. This is % achieved by asserting statements such as % % NODE: == isfunctional % == nonfunctional. % % Specifying that a path is functional doesn't actually constrain the % description to be functional - it merely tells the ALL node that it % need only fetch one value. % % Finally the special value 'no_definition' (distinct from 'undef') % indicates there is no definition here, but there may be further % definitions to be sought on paths. % % The comment following the code explains how this all works. ALL: <> == <">> == undefined == skip == defined == == "" == <""> == "<>" == "<>" "". % How it works: % % A query of, say , gets passed to ALL simply as . This % evaluates globally and turns the result into a path, prepended % by . This path is evaluated locally - if the result of % was 'undef', returns 'undefined', if it was 'no_definition', % it returns 'skip', and if it was anything else, % it returns 'defined'. This result value is itself interpreted as a % path (locally), with the original path () still appended. % returns nothing, just seeks values from (i.e. ignore the present alternative but still look for more). % does a further evaluation of and uses the % result of that to do either just if it's functional, or and % (i.e. seek alternatives) if it's not functional. % The next line is the Revision Control System Id: do not delete it. % $Id: archive.dtr,v 1.1 1997/04/09 20:40:33 root Exp $