Skip to content

Commit 7e82d30

Browse files
committed
Add comments about parameter normalization
1 parent 4df61b9 commit 7e82d30

10 files changed

Lines changed: 28 additions & 11 deletions

File tree

src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public StopAnalyzer(LuceneVersion matchVersion, CharArraySet stopWords)
8383
/// Builds an analyzer with the stop words from the given file. </summary>
8484
/// <seealso cref="WordlistLoader.GetWordSet(TextReader, LuceneVersion)"/>
8585
/// <param name="matchVersion"> See <see cref="LuceneVersion"/> </param>
86-
/// <param name="stopwordsFileName"> File name to load stop words from </param>
86+
/// <param name="stopwordsFileName"> File name to load stop words from. The path is not normalized by this method. </param>
8787
/// <remarks>
8888
/// LUCENENET: This overload takes a string file name to avoid allocating a <see cref="FileInfo"/> object.
8989
/// </remarks>

src/Lucene.Net.Analysis.Common/Analysis/Util/FilesystemResourceLoader.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public FilesystemResourceLoader()
5858
/// Files not found in file system and class lookups are delegated to context
5959
/// classloader.
6060
/// </summary>
61+
/// <param name="baseDirectory">The base directory path. The path is not normalized by this method.</param>
62+
/// <remarks>
63+
/// LUCENENET: This overload takes a string to avoid allocating a <see cref="DirectoryInfo"/> object.
64+
/// </remarks>
6165
public FilesystemResourceLoader(string? baseDirectory)
6266
: this(baseDirectory, new ClasspathResourceLoader(typeof(FilesystemResourceLoader)))
6367
{
@@ -91,6 +95,11 @@ public FilesystemResourceLoader(DirectoryInfo? baseDirectory, IResourceLoader @d
9195
/// Files not found in file system and class lookups are delegated
9296
/// to the given delegate <see cref="IResourceLoader"/>.
9397
/// </summary>
98+
/// <param name="baseDirectory">The base directory path. The path is not normalized by this method.</param>
99+
/// <param name="delegate">The delegate resource loader.</param>
100+
/// <remarks>
101+
/// LUCENENET: This overload takes a string to avoid allocating a <see cref="DirectoryInfo"/> object.
102+
/// </remarks>
94103
public FilesystemResourceLoader(string? baseDirectory, IResourceLoader @delegate)
95104
{
96105
// LUCENENET NOTE: If you call DirectoryInfo.Create() it doesn't set the DirectoryInfo.Exists

src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ protected static CharArraySet LoadStopwordSet(bool ignoreCase, Type aClass, stri
109109
/// <summary>
110110
/// Creates a <see cref="CharArraySet"/> from a file.
111111
/// </summary>
112-
/// <param name="stopwordsFileName">
113-
/// the stopwords file name to load
114-
/// </param>
112+
/// <param name="stopwordsFileName">The file name to load stopwords from. The path is not normalized by this method.</param>
115113
/// <param name="matchVersion">
116114
/// the Lucene version for cross version compatibility </param>
117115
/// <returns> a <see cref="CharArraySet"/> containing the distinct stopwords from the given

src/Lucene.Net.Benchmark/ByTask/Tasks/WriteEnwikiLineDocTask.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public WriteEnwikiLineDocTask(PerfRunData runData)
4444
}
4545

4646
/// <summary>Compose categories line file out of original line file</summary>
47-
// LUCENENET specific: changed to use string fileName instead of allocating a FileInfo (#832)
47+
/// <param name="fileName">The file name. The path is not normalized by this method.</param>
48+
/// <remarks>
49+
/// LUCENENET: This overload takes a string fileName instead of allocating a FileInfo.
50+
/// </remarks>
4851
public static string CategoriesLineFile(string fileName)
4952
{
5053
string dir = Path.GetDirectoryName(fileName);

src/Lucene.Net.Benchmark/ByTask/Utils/FileUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static bool FullyDelete(DirectoryInfo dir)
3636
/// <summary>
3737
/// Delete files and directories, even if non-empty.
3838
/// </summary>
39-
/// <param name="dirName">Directory path to delete.</param>
39+
/// <param name="dirName">Directory path to delete. The path is not normalized by this method.</param>
4040
/// <returns><c>true</c> on success, <c>false</c> if no or part of files have been deleted.</returns>
4141
/// <exception cref="IOException">If there is a low-level I/O error.</exception>
4242
/// <remarks>

src/Lucene.Net.Benchmark/ByTask/Utils/StreamUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static class StreamUtils // LUCENENET specific: CA1052 Static holder type
4747
/// based on the file name (e.g., if it ends with .bz2 or .bzip, return a
4848
/// 'bzip' <see cref="Stream"/>).
4949
/// </summary>
50+
/// <param name="fileName">The file name. The path is not normalized by this method.</param>
5051
/// <remarks>
5152
/// LUCENENET: This overload takes a string file name to avoid allocating a <see cref="FileInfo"/> object.
5253
/// </remarks>
@@ -83,6 +84,7 @@ private static FileType GetFileType(string fileName)
8384
/// Returns an <see cref="Stream"/> over the requested file, identifying
8485
/// the appropriate <see cref="Stream"/> instance similar to <see cref="GetInputStream(string)"/>.
8586
/// </summary>
87+
/// <param name="fileName">The file name. The path is not normalized by this method.</param>
8688
/// <remarks>
8789
/// LUCENENET: This overload takes a string file name to avoid allocating a <see cref="FileInfo"/> object.
8890
/// </remarks>

src/Lucene.Net.Suggest/Spell/PlainTextDictionary.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class PlainTextDictionary : IDictionary
4242
/// NOTE: content is treated as UTF-8
4343
/// </para>
4444
/// </summary>
45+
/// <param name="fileName">The file name. The path is not normalized by this method.</param>
4546
/// <remarks>
4647
/// LUCENENET: This overload takes a string to avoid having to allocate a <see cref="FileInfo"/> object.
4748
/// </remarks>

src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public JaspellTernarySearchTrie(FileInfo file)
233233
/// <para>Uses the culture of the current thread to lowercase words before comparing.</para>
234234
/// </summary>
235235
/// <param name="fileName">
236-
/// The file name with the data to load into the Trie. </param>
236+
/// The file name with the data to load into the Trie. The path is not normalized by this method. </param>
237237
/// <exception cref="IOException">
238238
/// A problem occured while reading the data. </exception>
239239
/// <remarks>
@@ -268,7 +268,7 @@ public JaspellTernarySearchTrie(FileInfo file, CultureInfo culture)
268268
/// <para>Uses the supplied culture to lowercase words before comparing.</para>
269269
/// </summary>
270270
/// <param name="fileName">
271-
/// The file name with the data to load into the Trie. </param>
271+
/// The file name with the data to load into the Trie. The path is not normalized by this method. </param>
272272
/// <param name="culture">The culture used for lowercasing.</param>
273273
/// <exception cref="IOException">
274274
/// A problem occured while reading the data. </exception>
@@ -305,7 +305,7 @@ public JaspellTernarySearchTrie(FileInfo file, bool compression)
305305
/// <para>Uses the culture of the current thread to lowercase words before comparing.</para>
306306
/// </summary>
307307
/// <param name="fileName">
308-
/// The file name with the data to load into the Trie. </param>
308+
/// The file name with the data to load into the Trie. The path is not normalized by this method. </param>
309309
/// <param name="compression">
310310
/// If true, the file is compressed with the GZIP algorithm, and if
311311
/// false, the file is a normal text document. </param>
@@ -356,7 +356,7 @@ public JaspellTernarySearchTrie(FileInfo file, bool compression, CultureInfo cul
356356
/// </para>
357357
/// </summary>
358358
/// <param name="fileName">
359-
/// The file name with the data to load into the Trie. </param>
359+
/// The file name with the data to load into the Trie. The path is not normalized by this method. </param>
360360
/// <param name="compression">
361361
/// If true, the file is compressed with the GZIP algorithm, and if
362362
/// false, the file is a normal text document. </param>

src/Lucene.Net/Util/Fst/FST.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ public void Save(DataOutput @out)
567567
/// <summary>
568568
/// Writes an automaton to a file.
569569
/// </summary>
570+
/// <param name="fileName">The file name. The path is not normalized by this method.</param>
570571
/// <remarks>
571572
/// LUCENENET: This overload takes a string file name to avoid allocating a <see cref="FileInfo"/> object.
572573
/// </remarks>

src/Lucene.Net/Util/IOUtils.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,12 @@ public static TextReader GetDecodingReader(Stream stream, Encoding charSet)
492492
/// Decoding readers are useful to load configuration files, stopword lists or synonym files
493493
/// to detect character set problems. However, its not recommended to use as a common purpose
494494
/// reader. </summary>
495-
/// <param name="fileName"> The file name to open a reader on </param>
495+
/// <param name="fileName"> The file name to open a reader on. The path is not normalized by this method. </param>
496496
/// <param name="charSet"> The expected charset </param>
497497
/// <returns> A reader to read the given file </returns>
498+
/// <remarks>
499+
/// LUCENENET: This overload takes a string file name to avoid allocating a <see cref="FileInfo"/> object.
500+
/// </remarks>
498501
public static TextReader GetDecodingReader(string fileName, Encoding charSet)
499502
{
500503
FileStream stream = null;

0 commit comments

Comments
 (0)