Platform
Resources
Pricing
Sign in
Get started
Shubhanshu Mishra
Researcher in Machine learning, Data Mining, Social Science, and Natural Language Processing Programming languages: Python, Java, and Java Script
Workspace
Fork
Public
By
Shubhanshu Mishra
Edited
Dec 14, 2023
Fork of
Search + Table
Insert cell
Insert cell
data
=
[
"port"
,
"sort"
,
"test"
,
"vest"
,
"rest"
]
Insert cell
viewof
search
=
Inputs
.
search
(
data
.
map
(
(
x
)
=>
new
Object
(
{
term
:
x
}
)
)
)
Insert cell
Inputs
.
table
(
search
)
Insert cell
unifiedString
=
`${
data
.
join
(
""
)
}$`
Insert cell
suffixArray
=
Array
.
from
(
unifiedString
)
.
map
(
(
x
,
i
)
=>
{
return
{
suffix
:
unifiedString
.
slice
(
i
)
,
i
:
i
}
;
}
)
.
sort
(
(
x
,
y
)
=>
x
.
suffix
.
localeCompare
(
y
.
suffix
)
)
Insert cell
viewof
searchSuffix
=
Inputs
.
search
(
suffixArray
)
Insert cell
Inputs
.
table
(
searchSuffix
)
Insert cell
[
1
,
5
]
.
map
(
(
i
)
=>
unifiedString
.
slice
(
i
)
)
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
search
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
unifiedString
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
suffixArray
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
searchSuffix
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML