BRIAN YU: Let's take a
look at similarities.
In the similarities problem, your
task is going to be to take two files
and to figure out how similar
they are to each other.
But what does similar actually mean?
Two files could be similar because
they have a lot of lines in common,
for example.
Or two files could be similar because
they have a lot of sentences in common.
Or two files could be
similar because they
have a lot of substrings in common.
And your task in this problem is
going to be to explore all three
of those different methods.
So here's what you'll have to do.
First, you'll implement
a function called
lines, which will compare two
files based on the number of lines
they have in common.
Then, you'll implement a
function called sentences,
which will compare files based
on the number of sentences
that they have in common.
And then, you'll implement a
function called substrings,
which will compare files based on
the number of substrings of length n
they have in common for any length n.
And then finally, we'll take
these functions to the web,
writing an HTML file called index.html,
which will display a web form where
the user can select two files and
how they want to compare them--
either by lines, or sentences, or
substrings-- and then submit that form,
at which point your
web page will display--
side-by-side-- those two files with any
similarities between them highlighted.
Let's get started.
