Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
openlaw-bot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Resource-IL
openlaw-bot
Commits
1197c174
Commit
1197c174
authored
Nov 23, 2020
by
Zvi Devir
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local
parent
71c7f63e
Pipeline
#99
failed with stage
in 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
bot.pl
bot.pl
+8
-8
No files found.
bot.pl
View file @
1197c174
...
...
@@ -409,7 +409,7 @@ sub process_law {
sub
auto_correct
{
my
$HE
=
'
(?:[א-ת][
\
x{05B0}-
\
x{05BD}]*+)
';
local
$_
=
shift
;
shift
;
tr/\x{FEFF}//d
;
# Unicode marker
tr/\x{2000}-\x{200A}\x{205F}/ /
;
# typographic spaces
tr/\x{200B}-\x{200D}//d
;
# zero-width spaces
...
...
@@ -488,7 +488,7 @@ sub possible_redirects {
$page
=~
s/(\,? ה?תש.?["״].[-–]\d{4}|, *[^ ]*\d{4}|, מס['׳] \d+ לשנת \d{4}| [-–] ה?תש.?["״]. מיום \d+.*|\, *\d+ עד \d+| [-–] ה?תש.?["״].)$//
;
for
(
my
$k
=
0
;
$k
<
32
;
$k
++
)
{
my
$_
=
$page
;
$_
=
$page
;
if
(
$k
&
1
)
{
s/[–־]+/-/g
;
};
# else { s/(?<=[א-ת])[\-־](?=[א-ת])/־/g; }
if
(
$k
&
2
)
{
s/ – / - /g
;
s/--/-/g
;}
else
{
s/--/–/g
;
s/ - / – /g
;
}
if
(
$k
&
4
)
{
s/(?<=[א-ת])[\-־](?=[א-ת])/ /g
;
}
...
...
@@ -511,8 +511,8 @@ sub RunParsers {
sub
load_credentials
{
my
%
obj
;
local
$_
=
shift
;
open
(
my
$FIN
,
$
_
)
||
die
"
Cannot open file
\"
$_
\"
!
\n
";
my
$file
=
shift
;
open
(
my
$FIN
,
$
file
)
||
die
"
Cannot open file
\"
$file
\"
!
\n
";
while
(
<
$FIN
>
)
{
if
(
m/^ *(.*?) *= *(.*?) *$/
)
{
$obj
{
$1
}
=
$2
;
...
...
@@ -563,7 +563,7 @@ sub parse_actions {
}
}
my
$line
=
-
1
;
foreach
my
$_
(
@_
)
{
foreach
(
@_
)
{
$line
++
;
next
if
!
(
/^ *\*/
)
||
/\{\{v\}\}/
||
/\{\{x\}\}/
;
if
(
/\[\[(.*?)\]\].*?\[\[(.*?)\]\]/
)
{
...
...
@@ -582,7 +582,7 @@ sub parse_actions {
}
sub
clean_name
{
local
$_
=
shift
;
shift
;
s/\[\[(.*?)\|?.*?\]\]/$1/
;
s/^ *(.*?) *$/$1/
;
s/^מקור: *//
;
...
...
@@ -592,7 +592,7 @@ sub clean_name {
}
sub
canonic_name
{
local
$_
=
shift
;
shift
;
tr/–־/-/
;
tr/״”“/"/
;
tr/׳‘’/'/
;
...
...
@@ -604,7 +604,7 @@ sub canonic_name {
}
sub
convert_regexp
{
local
$_
=
shift
;
shift
;
s/([.()\[\]])/\\$1/g
;
s/\*/.*/g
;
s/\?/./g
;
...
...
uda
@uda
mentioned in commit
a88165e9
·
Nov 25, 2020
mentioned in commit
a88165e9
mentioned in commit a88165e9e430db7abe646050c2f28dc9af448a82
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment