0

If the sequence of letters lexicographically precedes the first word on the page, we know to go backwards.

Why is it go backwards? I think it should be go forward. How to understand this sentence?

I got this sentence from a python textbook (Introduction to Computation and Programming Using Python). The whole paragraph is as follows:

Fortunately, the folks who publish hard-copy dictionaries go to the trouble of putting the words in lexicographical order. This allows us to open the book to a page where we think the word might lie (e.g., near the middle for words starting with the letter m). If the sequence of letters lexicographically precedes the first word on the page, we know to go backwards. If the sequence of letters follows the last word on the page, we know to go forwards. Otherwise, we check whether the sequence of letters matches a word on the page.

1
  • Please include the source where you found the sentence and some context. It looks like you found this at venali.medium.com/… ?
    – stangdon
    Commented Jan 10, 2023 at 17:41

1 Answer 1

4

The sentence looks correct as it is. The author is talking about looking up a sequence of letters in a dictionary.

We can break it down like this:

If the sequence of letters (that we are looking for)
lexicographically (in dictionary order)
precedes (comes before)
the first word on the page, (of the dictionary that we are looking at)
we know to go backwards. (in the dictionary)

So for example, if our sequence of letters is DESTITUTE, but the first word on the dictionary page that we are looking at is DIBBLE, we would go backwards in the dictionary (to an earlier page) because DESTITUTE comes before DIBBLE in dictionary order.

2
  • 1
    One wonders why they don't just say alphabetically....
    – Lambie
    Commented Jan 10, 2023 at 18:02
  • @Lambie - that's Pythonistas for you. One reason I prefer Ruby as a language. Commented Jan 10, 2023 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .