Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
cloogle.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cloogle
cloogle.org
Commits
c0b85ce0
Commit
c0b85ce0
authored
Mar 01, 2016
by
Mart Lubbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2f7a41b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
api.php
api.php
+5
-3
No files found.
api.php
View file @
c0b85ce0
...
...
@@ -6,7 +6,8 @@ define('PRE_IDENT', '[\w~@#$%^?!+\-*<>\/|&=:`]+');
define
(
'PRE_MODULE'
,
"/\s*(?:definition\s*|system\s*|implementation\s*)module\s+(\S+)\s*[
\n
;]/"
);
define
(
'PRE_FUNC'
,
'/^\s*(?:instance|class)?\s*\(?('
.
PRE_IDENT
.
')\)?\s*(?:infix[lr]?\s+\d\s*)?(?:\s+a\s+)?::.*$/mi'
);
'/^(?:\\/\\/)?\s*(?:instance|class)?\s*\(?('
.
PRE_IDENT
.
')\)?\s*(?:infix[lr]?\s+\d\s*(?:\\/\\/)?)?(?:\s+a\s+)?::.*$/mi'
);
function
search_doc
(
&
$r
,
$name
,
$libraries
){
foreach
(
$libraries
as
$library
=>
$librarypath
){
...
...
@@ -24,11 +25,12 @@ function search_doc(&$r, $name, $libraries){
$lowername
=
strtolower
(
$name
);
$lowerfuncname
=
strtolower
(
$funcname
);
if
(
strstr
(
$lowerfuncname
,
$lowername
)
!==
FALSE
){
$score
=
-
1
;
$score
=
-
1
*
strlen
(
$funcname
)
+
levenshtein
(
$lowername
,
$lowerfuncname
);
}
else
{
$score
=
levenshtein
(
$lowername
,
$lowerfuncname
);
}
if
(
$score
<
strlen
(
$
func
name
)
/
2
){
if
(
$score
<
strlen
(
$name
)
/
2
){
array_push
(
$r
,
array
(
"library"
=>
$library
,
"filename"
=>
$filename
,
...
...
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