<commit_before>xquery version "1.0";
(:
 : Copyright 2006-2011 The FLWOR Foundation.
 :
 : Licensed under the Apache License, Version 2.0 (the "License");
 : you may not use this file except in compliance with the License.
 : You may obtain a copy of the License at
 :
 : http://www.apache.org/licenses/LICENSE-2.0
 :
 : Unless required by applicable law or agreed to in writing, software
 : distributed under the License is distributed on an "AS IS" BASIS,
 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 : See the License for the specific language governing permissions and
 : limitations under the License.
:)

(:~
 : This module allows to retrieve an xs:anyURI representation of a
 : node position. This module also defines function that determine: 
 : (1) the relationship between two nodes (e.g. if one is the ancestor
 : of another) and (2) properties of a node (e.g. its level in the tree)
 : given the corresponding nodes positions.
 :
 : @author <NAME> 
 :)
module namespace np = "http://www.zorba-xquery.com/modules/node-position";
declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
declare option ver:module-version "2.0";

(:~
 : Compute a stable and opaque structural information representation 
 : (with type xs:anyURI) for a given node.
 :
 : <p>The returned URI is stable, i.e. it does not change when other 
 : nodes are inserted, deleted or modified.</p>
 : 
 : <p>Each node in a snapshot has a different URI. Note however that
 : different nodes in different snapshots might have the same URI.</p>  
 :
 : @param $arg the node for which the structural information URI
 :  should be computed
 :
 : @return the opaque structural information URI of the node.
 :)
declare function np:node-position(
  $arg as node()
) as xs:anyURI external;

(:~
 : Determines whether the node whose structural information is 
 : given as second argument is an ancestor of the node whose 
 : structural information is given as first argument.
 :
 : @param $s-info1 the potential descendant structural information
 : @param $s-info2 the potential ancestor structural information
 :<commit_msg>modified the introduction for the module documentation<commit_after>xquery version "1.0";
(:
 : Copyright 2006-2011 The FLWOR Foundation.
 :
 : Licensed under the Apache License, Version 2.0 (the "License");
 : you may not use this file except in compliance with the License.
 : You may obtain a copy of the License at
 :
 : http://www.apache.org/licenses/LICENSE-2.0
 :
 : Unless required by applicable law or agreed to in writing, software
 : distributed under the License is distributed on an "AS IS" BASIS,
 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 : See the License for the specific language governing permissions and
 : limitations under the License.
:)

(:~
 : This module provides a function (np:node-position) that given, a node, 
 : returns positional information about the node in the form of an xs:anyURI
 : item. The module also defines functions that use such positional information
 : to determine: (1) structural relationships between two nodes (e.g. if one 
 : is the ancestor of another) and (2) properties of a node (e.g. its level in 
 : the tree).
 :
 : Within this module, the temp "node position" will be used to refer to an
 : xs:anyURI item that is returned by the np:node-position function.
 :
 : @author <NAME> 
 :)
module namespace np = "http://www.zorba-xquery.com/modules/node-position";

declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
declare option ver:module-version "2.0";

(:~
 : Compute a stable and opaque structural information representation 
 : (with type xs:anyURI) for a given node.
 :
 : <p>The returned URI is stable, i.e. it does not change when other 
 : nodes are inserted, deleted or modified.</p>
 : 
 : <p>Each node in a snapshot has a different URI. Note however that
 : different nodes in different snapshots might have the same URI.</p>  
 :
 : @param $arg the node for which the structural information URI
 :  should be computed
 :
 : @return the opaque structural information URI of the node.
 :)
declare function np:node-position(
  $arg as node()
) as xs:anyURI external;

(:~
 : Determines whether the node whose structural information is 
 : given as second argument is an ancestor of the node whose 
 : structural information is given as first argument.
 :
 : @param $s-info1 the potential descendant structural information
 : @param $s-info2 the potential ancestor structural information
 :
{'fraction_non_alphanumeric': 0.08318700614574188, 'fraction_numerical': 0.00877963125548727, 'mean_word_length': 3.9478827361563518, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7585174', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1175, 'n_words': 592}