Skip to content

Commit

Permalink
SWEEP: Added XML comments for Main(args) methods that are only intend…
Browse files Browse the repository at this point in the history
…ed for command line CLI usage.
  • Loading branch information
rclabo committed Sep 25, 2024
1 parent c04fe30 commit 54ea777
Show file tree
Hide file tree
Showing 28 changed files with 414 additions and 35 deletions.
14 changes: 14 additions & 0 deletions src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace Lucene.Net.Analysis.Ja.Util
* limitations under the License.
*/

/// <summary>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: analysis kuromoji-build-dictionary.
/// </summary>
public static class DictionaryBuilder // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable
{
public enum DictionaryFormat { IPADIC, UNIDIC };
Expand Down Expand Up @@ -62,6 +69,13 @@ ConnectionCostsWriter connectionCosts
Console.WriteLine("done");
}

/// <summary>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: analysis kuromoji-build-dictionary.
/// </summary>
public static void Main(string[] args)
{
DictionaryFormat format;
Expand Down
14 changes: 14 additions & 0 deletions src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ namespace Egothor.Stemmer
{
/// <summary>
/// The Compile class is used to compile a stemmer table.
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: analysis stempel-compile-stems
/// </para>
/// </summary>
public static class Compile // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable
{
Expand All @@ -74,6 +81,13 @@ public static class Compile // LUCENENET specific: CA1052 Static holder types sh
private static Trie trie;

/// <summary>
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: analysis stempel-compile-stems.
/// </para>
/// Entry point to the Compile application.
/// <para/>
/// This program takes any number of arguments: the first is the name of the
Expand Down
14 changes: 14 additions & 0 deletions src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ created by Leo Galambos ([email protected]).
namespace Egothor.Stemmer
{
/// <summary>
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: analysis stempel-patch-stems.
/// </para>
/// The DiffIt class is a means generate patch commands from an already prepared
/// stemmer table.
/// </summary>
Expand All @@ -82,6 +89,13 @@ internal static int Get(int i, string s)
}

/// <summary>
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: analysis stempel-patch-stems.
/// </para>
/// Entry point to the DiffIt application.
/// <para>
/// This application takes one argument, the path to a file containing a
Expand Down
7 changes: 7 additions & 0 deletions src/Lucene.Net.Benchmark/ByTask/Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ public virtual void Execute()
}

/// <summary>
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: benchmark.
/// </para>
/// Run the benchmark algorithm.
/// </summary>
/// <param name="args">Benchmark config and algorithm files.</param>
Expand Down
16 changes: 16 additions & 0 deletions src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,25 @@ namespace Lucene.Net.Benchmarks.ByTask.Programmatic

/// <summary>
/// Sample performance test written programmatically - no algorithm file is needed here.
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: benchmark sample.
/// </para>
/// </summary>
public static class Sample // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable
{

/// <summary>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: benchmark sample.
/// </summary>
/// <param name="args"></param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Sample shows optional args[] parameter")]
public static void Main(string[] args)
{
Expand Down
17 changes: 17 additions & 0 deletions src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,26 @@ namespace Lucene.Net.Benchmarks.Quality.Trec

/// <summary>
/// Command-line tool for doing a TREC evaluation run.
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: benchmark run-trec-eval.
/// </para>
/// </summary>
public static class QueryDriver // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable
{

/// <summary>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: benchmark run-trec-eval.
/// </summary>
/// <param name="args">Must contain 4 or 5 values</param>
/// <exception cref="ArgumentException"></exception>
public static void Main(string[] args)
{
if (args.Length < 4 || args.Length > 5)
Expand Down
13 changes: 12 additions & 1 deletion src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ namespace Lucene.Net.Benchmarks.Quality.Utils
/// <summary>
/// Suggest Quality queries based on an index contents.
/// Utility class, used for making quality test benchmarks.
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: benchmark find-quality-queries.
/// </para>
/// </summary>
public class QualityQueriesFinder
{
Expand All @@ -43,7 +50,11 @@ private QualityQueriesFinder(Store.Directory dir)
}

/// <summary>
///
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: benchmark find-quality-queries.
/// </summary>
/// <param name="args">{index-dir}</param>
/// <exception cref="IOException">if cannot access the index.</exception>
Expand Down
8 changes: 8 additions & 0 deletions src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ protected virtual void ExtractFile(FileInfo sgmFile)
}
}

/// <summary>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: benchmark extract-reuters.
/// </summary>
/// <param name="args"></param>
public static void Main(string[] args)
{
if (args.Length != 2)
Expand Down
8 changes: 8 additions & 0 deletions src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ public virtual void Extract()
Console.WriteLine("Extraction took " + (finish - start) + " ms");
}

/// <summary>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: benchmark extract-wikipedia.
/// </summary>
/// <param name="args"></param>
public static void Main(string[] args)
{

Expand Down
12 changes: 11 additions & 1 deletion src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,17 @@ public FacetResult RunDrillDown()
}


/// <summary>Runs the sum int/float associations examples and prints the results.</summary>
/// <summary>
/// Runs the sum int/float associations examples and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo associations-facets.
/// </para>
/// </summary>
/// <param name="args">Unused</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Demo shows use of optional args argument")]
public static void Main(string[] args)
{
Expand Down
11 changes: 10 additions & 1 deletion src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,16 @@ public void Dispose()
indexDir?.Dispose();
}

/// <summary>Runs the search and drill-down examples and prints the results.</summary>
/// <summary>
/// Runs the search and drill-down examples and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo distance-facets.
/// </para>
/// </summary>
public static void Main(string[] args)
{
using DistanceFacetsExample example = new DistanceFacetsExample();
Expand Down
12 changes: 11 additions & 1 deletion src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,17 @@ public FacetResult RunSearch()
return Search();
}

/// <summary>Runs the search and drill-down examples and prints the results.</summary>
/// <summary>
/// Runs the search and drill-down examples and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo expression-aggregation-facets.
/// </para>
/// </summary>
/// <param name="args">Unused</param>
public static void Main(string[] args)
{
Console.WriteLine("Facet counting example:");
Expand Down
12 changes: 11 additions & 1 deletion src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,17 @@ public IList<FacetResult> RunSearch()
return Search();
}

/// <summary>Runs the search example and prints the results.</summary>
/// <summary>
/// Runs the search example and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo multi-category-lists-facets.
/// </para>
/// </summary>
/// <param name="args">Unused</param>
public static void Main(string[] args)
{
Console.WriteLine("Facet counting over multiple category lists example:");
Expand Down
12 changes: 11 additions & 1 deletion src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,17 @@ public void Dispose()
indexDir?.Dispose();
}

/// <summary>Runs the search and drill-down examples and prints the results.</summary>
/// <summary>
/// Runs the search and drill-down examples and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo range-facets.
/// </para>
/// </summary>
/// <param name="args">Unused</param>
public static void Main(string[] args)
{
using RangeFacetsExample example = new RangeFacetsExample();
Expand Down
12 changes: 11 additions & 1 deletion src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,17 @@ public IList<FacetResult> RunDrillSideways()
return DrillSideways();
}

/// <summary>Runs the search and drill-down examples and prints the results.</summary>
/// <summary>
/// Runs the search and drill-down examples and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo simple-facets.
/// </para>
/// </summary>
/// <param name="args">Unused</param>
public static void Main(string[] args)
{
Console.WriteLine("Facet counting example:");
Expand Down
12 changes: 11 additions & 1 deletion src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,17 @@ public FacetResult RunDrillDown()
return DrillDown();
}

/// <summary>Runs the search and drill-down examples and prints the results.</summary>
/// <summary
/// >Runs the search and drill-down examples and prints the results.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo simple-sorted-set-facets.
/// </para>
/// </summary>
/// <param name="args">Unused</param>
public static void Main(string[] args)
{
Console.WriteLine("Facet counting example:");
Expand Down
24 changes: 22 additions & 2 deletions src/Lucene.Net.Demo/IndexFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,35 @@

namespace Lucene.Net.Demo
{
// LUCENENET: Not used
///// Run it with no command-line arguments for usage information.


/// <summary>
/// Index all text files under a directory.
/// <para/>
/// This is a command-line application demonstrating simple Lucene indexing.
/// Run it with no command-line arguments for usage information.
/// <para>
/// LUCENENET specific: This class is not for direct use. In the Java implementation
/// it's Main method was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to that method: demo index-files.
/// </para>
/// </summary>
public static class IndexFiles // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable
{
/// <summary>Index all text files under a directory.</summary>
/// <summary>
/// Index all text files under a directory.
/// <para>
/// LUCENENET specific: This method is not for direct use. In the Java implementation
/// it was intended to be called from the command line. However in .NET a
/// method within a DLL can't be directly called from the command line so we
/// provide a <see href="https://www.nuget.org/packages/lucene-cli">lucene-cli</see>
/// with a command that maps to this method: demo index-files.
/// </para>
/// </summary>
/// <param name="args"></param>
public static void Main(string[] args)
{
// The <CONSOLE_APP_NAME> should be the assembly name of the application
Expand Down
Loading

0 comments on commit 54ea777

Please sign in to comment.