Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grammar and typo fixes #14019

Merged
merged 6 commits into from
Dec 3, 2024
Merged

Grammar and typo fixes #14019

merged 6 commits into from
Dec 3, 2024

Conversation

viliam-durina
Copy link
Contributor

A random collection while reading through the code.

A random collection while reading through the code.
@@ -184,7 +184,7 @@ List<DocumentsWriterPerThread> filterAndLock(Predicate<DocumentsWriterPerThread>
/**
* Removes the given DWPT from the pool unless it's already been removed before.
*
* @return <code>true</code> iff the given DWPT has been removed. Otherwise <code>false</code>
* @return <code>true</code>, iff the given DWPT has been removed. Otherwise <code>false</code>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe fix /iff/if/ since you are at it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Iff" is correct, it means "if and only if", see https://www.merriam-webster.com/dictionary/iff

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is all about syntax, grammar, etc, we might as well italicize iff since that is how it is generally done, as in the example you cited.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, the comma you inserted is not correct (try replacing iff with "if and only if" - we wouldn't use a comma before "if").

Copy link
Contributor

@msokolov msokolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started reviewing these one by one, but as I go I find that many of these changes insert unneeded commas and other agrammatical constructions that are sometimes worse than the original (which admittedly could stand to be improved). If you really want to work on this, I am happy to give out more grammar pedantry (it tickles some kind of weird obsession I have), but maybe it is not worth our time?

@@ -184,7 +184,7 @@ List<DocumentsWriterPerThread> filterAndLock(Predicate<DocumentsWriterPerThread>
/**
* Removes the given DWPT from the pool unless it's already been removed before.
*
* @return <code>true</code> iff the given DWPT has been removed. Otherwise <code>false</code>
* @return <code>true</code>, iff the given DWPT has been removed. Otherwise <code>false</code>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, the comma you inserted is not correct (try replacing iff with "if and only if" - we wouldn't use a comma before "if").

* <p>Changes to the content of an index are made visible only after the writer who made that change
* commits by writing a new segments file (<code>segments_N</code>). This point in time, when the
* action of writing of a new segments file to the directory is completed, is an index commit.
* <p>Changes to the content of an index are made visible only after the writer which made that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry this is wrong. We could use that, but who is also correct - no need to "fix" it,

* commits by writing a new segments file (<code>segments_N</code>). This point in time, when the
* action of writing of a new segments file to the directory is completed, is an index commit.
* <p>Changes to the content of an index are made visible only after the writer which made that
* change commits by writing a new segments file (<code>segments_N</code>). This point in time, when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this sentence is awkward, but what you've done here doesn't really address the core problem. I think it really would be most correct as: "The point in time (no comma) when ... is completed (no comma) is an index commit".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, I did read this as if the writer was a human; not sure why! I still think that is better than which not sure why exactly. I think this page describes the difference well: https://www.dictionary.com/e/that-vs-which/ -- if the restrictive clause is essential to the meaning of the sentence, as it is here, we use that.

@@ -33,7 +33,7 @@ public enum IndexOptions {
DOCS,
/**
* Only documents and term frequencies are indexed: positions are omitted. This enables normal
* scoring, except Phrase and other positional queries will throw an exception.
* scoring, except phrase and other positional queries will throw an exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer to avoid this ambiiguity by using PhraseQuery explicitly

@@ -101,8 +101,8 @@
* whether a new index is created, or whether an existing index is opened. Note that you can open an
* index with {@link OpenMode#CREATE} even while readers are using the index. The old readers will
* continue to search the "point in time" snapshot they had opened, and won't see the newly created
* index until they re-open. If {@link OpenMode#CREATE_OR_APPEND} is used IndexWriter will create a
* new index if there is not already an index at the provided path and otherwise open the existing
* index until they re-open. If {@link OpenMode#CREATE_OR_APPEND} is used, IndexWriter will create a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not a great sentence, but fixing it requires a bigger rewrite; I don't think that this change is better (the "will" has no subject).

@@ -123,13 +123,13 @@
* IndexWriterConfig#setRAMBufferSizeMB}) or the number of added documents (see {@link
* IndexWriterConfig#setMaxBufferedDocs(int)}). The default is to flush when RAM usage hits {@link
* IndexWriterConfig#DEFAULT_RAM_BUFFER_SIZE_MB} MB. For best indexing speed you should flush by RAM
* usage with a large RAM buffer. In contrast to the other flush options {@link
* IndexWriterConfig#setRAMBufferSizeMB} and {@link IndexWriterConfig#setMaxBufferedDocs(int)},
* usage with a large RAM buffer. In contrast to the other flush options, in case of {@link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's leave this as it was. It was OK.

@viliam-durina
Copy link
Contributor Author

viliam-durina commented Dec 2, 2024

Thanks for the review 👍

I reverted all the disputed changes, agree we should not go into unproductive discussions. I added a few new ones, they are in a separate commit to simplify the review.

I'll only have a note to the writer ... who (#14019 (comment)) - "who" should be used only for persons, this writer is not a person. But I reverted it anyway.

Copy link
Contributor

@msokolov msokolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the fixes! I reviewed them all this time, and I think there are just a couple of changes I'd like to see before merging.

@@ -141,7 +141,7 @@
* soon as a new commit is done. Creating your own policy can allow you to explicitly keep previous
* "point in time" commits alive in the index for some time, either because this is useful for your
* application, or to give readers enough time to refresh to the new commit without having the old
* commit deleted out from under them. The latter is necessary when multiple computers take turns
* commit deleted under their hands. The latter is necessary when multiple computers take turns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sounds like an idiom of sort, but I've never heard it -- I think the existing phrasing is more idiomatic of the English I know anyway.

* some kind of sequence ID is available in the index.
* an arbitrary query to mark all documents that should survive the merge. This can be used, for
* example, to keep all document modifications for a certain time interval or the last N
* operations if some kind of sequence ID is available in the index.
*
* <p>Currently there is no API support to un-delete a soft-deleted document. In oder to un-delete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix "In oder" to be "In order"?

Copy link
Contributor

@msokolov msokolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@msokolov msokolov merged commit 9c86bed into apache:main Dec 3, 2024
3 checks passed
@msokolov
Copy link
Contributor

msokolov commented Dec 3, 2024

BTW I am fascinated by your github avatar pic! I feel like I have seen it before but not sure where? I tried image search but it does not find it. Is it something well known?

@viliam-durina
Copy link
Contributor Author

BTW I am fascinated by your github avatar pic! I feel like I have seen it before but not sure where? I tried image search but it does not find it. Is it something well known?

It's an illustration from a children book by Albín Brunovský 😄

@msokolov
Copy link
Contributor

msokolov commented Dec 3, 2024

wow those books would scare any child that I know!

@viliam-durina viliam-durina deleted the grammar branch December 3, 2024 18:33
@viliam-durina
Copy link
Contributor Author

wow those books would scare any child that I know!

I don't know a child that would be scared by them 😄 .
Mine are not, and I wasn't when I was a child.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants