Added 'lex' suffix to child bootstrapped grammars' names.
authorYeGoblynQueenne@splinter <ep50@uni.brighton.ac.uk>
Tue, 30 Aug 2016 05:43:15 +0000 (08:43 +0300)
committerYeGoblynQueenne@splinter <ep50@uni.brighton.ac.uk>
Tue, 30 Aug 2016 05:43:15 +0000 (08:43 +0300)
tree_learning/configuration.pl

index 38b2bb1..2091551 100644 (file)
@@ -258,7 +258,7 @@ language_file_name(ability_text).
 %      @NOTE: Also, anything besides "none" will do- "first_nonterinal"
 %      is just something descriptive. Obviously, this needs fixing.
 %
-lexicalisation_strategy(first_nonterminal).
+lexicalisation_strategy(none).
 
 
 %!     output_stream(?Type,?Name) is det.
@@ -296,7 +296,6 @@ output_file_name(grammar, Path):-
          ,(   Lex == none
          ->  Lx = []
          ;   Lx = lex
-
          )
        ,findall(Name
                ,(member(Name,[F,K_,N_,S_,E,L,T,Lx])
@@ -325,6 +324,7 @@ output_file_name(skeleton_graph,output(Filename)):-
 
 % Hackery amount is rising. Start_symbol is the indexed start symbol
 % of a bootstrapped grammar. See skeleton_transformation for details.
+% Btw, this is the filename of _child_ grammars (bags)
 output_file_name(bootstrapped_grammar(Start_symbol), bags(Filename)):-
        % Leaving Start_symbol variable breaks utilities:current_configuration/1
        % Might need to fix that there, rather than here. Just saying.
@@ -342,10 +342,20 @@ output_file_name(bootstrapped_grammar(Start_symbol), bags(Filename)):-
        ,bootstrapping(Sm,Sz)
        ,examples_file_name(E)
        ,language_file_name(L)
+       ,lexicalisation_strategy(Lex)
+       ,(   Lex == none
+         ->  Lx = []
+         ;   Lx = lex
+         )
        ,output_type(T)
        ,output_format(T, Ext)
        ,atomic_list_concat([Zero,Num],'.',Sz)
-       ,atomic_list_concat([Start_symbol,of,Sm,by,Zero,Num,F,E,L],'_',Base)
+       ,findall(Name
+               ,(member(Name,[Start_symbol,of,Sm,by,Zero,Num,F,E,L,Lx])
+                ,Name \= []
+                )
+               ,Names)
+       ,atomic_list_concat(Names,'_',Base)
        ,atom_concat(Base,Ext,Filename).