amalgame/commit
remove now redundent token arity module
author | Jacco van Ossenbruggen |
---|---|
Mon Sep 8 23:04:06 2014 +0200 | |
committer | Jacco van Ossenbruggen |
Mon Sep 8 23:04:06 2014 +0200 | |
commit | 80a5468887475e603c93e47c8cf22e60d7f459a1 |
tree | c613cfca7aa5ed0062c7cc7e4bc5a78514ef5a7a |
parent | 2478d33171759060b723f18a4450e1541670367c |
Diff style: patch stat
diff --git a/config-available/ag_modules.pl b/config-available/ag_modules.pl index 60afd17..debcd5b 100644 --- a/config-available/ag_modules.pl +++ b/config-available/ag_modules.pl @@ -28,7 +28,6 @@ :- use_module(library(ag_modules/most_labels)). :- use_module(library(ag_modules/most_methods)). :- use_module(library(ag_modules/sibling_selecter)). -:- use_module(library(ag_modules/token_arity_select)). % Vocabulary partitioners: :- use_module(library(ag_modules/voc_exclude)). diff --git a/lib/ag_modules/token_arity_select.pl b/lib/ag_modules/token_arity_select.pl deleted file mode 100644 index 6fffa87..0000000 --- a/lib/ag_modules/token_arity_select.pl +++ /dev/null @@ -1,80 +0,0 @@ -:- module(token_arity_select,[]). - -:- use_module(library(amalgame/map)). - -:- public amalgame_module/1. -:- public selecter/5. -:- public parameter/4. - -amalgame_module(amalgame:'TokenAritySelect'). - -parameter(type, oneof(['11','1N','N1']), '11', - 'Type of arity to select: - 1-1 = unique source and target, - 1-N = unique source for a target'). - -%% selecter(+Mapping, -Selected, -Discarded, -Undecided, +Options) -% -% Selected contains only the unique correspondences between -% a source and target concept. - -selecter(Mapping, Sel, Dis, [], Options) :- - ( option(type('11'), Options) - -> select_1_1(Mapping, Sel, Dis) - ; option(type('N1'), Options) - -> select_n_1(Mapping, Sel, Dis) - ; option(type('1N'), Options) - -> select_1_n(Mapping, Sel, Dis) - ). - -%% select_1_1(+Mapping, -Mapping_1_1, -Rest) -% -% Mapping_1_1 contains all unique correspondences. - -select_1_1([],[],[]). -select_1_1([Head|Tail], Sel, Dis) :- - select_1_1(Tail, SelT, DisT), - Head = align(_,_,Prov), - member(token_ambiguity(N), Prov), - ( N > 1 - -> Sel = SelT, Dis = [Head|DisT] - ; Dis = DisT, Sel = [Head|SelT] - ). - -%% selecter(+Mapping, -Mapping_n_1, -Rest) -% -% Selected contains all correspondance where a source is mapped to -% only one target. - -select_n_1([], [], []). -select_n_1([align(S,T,P)|As], A1, A2) :- - same_source(As, S, Same, Rest), - ( Same = [] - -> A1 = [align(S,T,P)|A1Rest], - A2 = A2Rest - ; append([align(S,T,P)|Same], A2Rest, A2), - A1 = A1Rest - ), - select_n_1(Rest, A1Rest, A2Rest). - -%% select_1_n(+Mapping, -Mapping_1_n, -Rest) -% -% Mapping_1_n contains all correspondences where a target is -% mapped to only one source. - -select_1_n(Mapping, Sel, Dis) :- - predsort(ag_map:compare_align(target), Mapping, TargetSorted), - select_1_n_(TargetSorted, Sel0, Dis0), - sort(Sel0, Sel), - sort(Dis0, Dis). - -select_1_n_([], [], []). -select_1_n_([align(S,T,P)|As], A1, A2) :- - same_target(As, T, Same, Rest), - ( Same = [] - -> A1 = [align(S,T,P)|A1Rest], - A2 = A2Rest - ; append([align(S,T,P)|Same], A2Rest, A2), - A1 = A1Rest - ), - select_1_n_(Rest, A1Rest, A2Rest). diff --git a/rdf/tool/ag_modules.ttl b/rdf/tool/ag_modules.ttl index 0a5cac0..06b38ab 100644 --- a/rdf/tool/ag_modules.ttl +++ b/rdf/tool/ag_modules.ttl @@ -132,11 +132,6 @@ amalgame:SiblingSelecter skos:definition "Select the siblings (if any) among alternatives for the same source/target. This is used, for example, when a single source with two labels matches on two distinct but very similar targets and both mappings need to be preserved. "@en ; rdfs:subClassOf amalgame:MappingPartitioner . -amalgame:TokenAritySelect - rdfs:label "ambiguity/remove (token) "@en ; - skos:definition "Similar to ambiguity/remove but now on the level of splitted compound labels"@en ; - rdfs:subClassOf amalgame:MappingPartitioner . - ######## Vocabulary partitioner classes: amalgame:VocExclude