Skip to content

Commit

Permalink
fixing eye issue eyereasoner/eye#115
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Aug 30, 2024
1 parent 68640d2 commit 469b4d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
31 changes: 21 additions & 10 deletions lingua.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('lingua v1.3.0').
version_info('lingua v1.3.1').

help_info('Usage: lingua <options>* <data>*

Expand Down Expand Up @@ -2720,7 +2720,8 @@
when(
( ground(A)
),
( sub_atom(A, 0, B, 0, _)
( escape_atom(A, C),
sub_atom(C, 0, B, 0, _)
)
).

Expand Down Expand Up @@ -2774,7 +2775,8 @@
( ground([X, Search, Replace])
),
( ( atomic_list_concat(['(', Search, ')'], Se),
regex(Se, X, [S|_])
regex(Se, X, [St|_]),
escape_atom(S, St)
-> ( sub_atom(Search, 0, 1, _, '^')
-> atom_concat(S, T, X),
atom_concat(Replace, T, Y)
Expand Down Expand Up @@ -2810,7 +2812,8 @@
( ground([X, Y])
),
( regex(Y, X, [W|_]),
atom_string(Z, W)
atom_string(V, W),
escape_atom(Z, V)
)
).

Expand Down Expand Up @@ -3339,6 +3342,18 @@
; true
).

escape_atom(A, B) :-
ground(A),
!,
atom_codes(A, C),
escape_codes(D, C),
atom_codes(B, D).
escape_atom(A, B) :-
ground(B),
atom_codes(B, C),
escape_codes(C, D),
atom_codes(A, D).

escape_string([], []) :-
!.
escape_string([0'\t|A], [0'\\, 0't|B]) :-
Expand Down Expand Up @@ -4276,12 +4291,8 @@
~`0t~16r~12+', [A, B, C, D, E]).

regex(Pattern, String, List) :-
atom_codes(Pattern, PatternC),
escape_string(PatC, PatternC),
atom_codes(Pat, PatC),
atom_codes(String, StringC),
escape_string(StrC, StringC),
atom_codes(Str, StrC),
escape_atom(Pattern, Pat),
escape_atom(String, Str),
re_matchsub(Pat, Str, Dict, []),
findall(Value,
( get_dict(Key, Dict, Value),
Expand Down

0 comments on commit 469b4d2

Please sign in to comment.