Skip to content

Commit

Permalink
Fix several xref map issues in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Oct 12, 2024
1 parent 1695ac0 commit 1eb0638
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Lucene.Net.Analysis.OpenNLP/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This module exposes functionality from Apache OpenNLP to Apache Lucene.NET. The

For an introduction to Lucene's analysis API, see the [Lucene.Net.Analysis](../core/Lucene.Net.Analysis.html) namespace documentation.

The OpenNLP Tokenizer behavior is similar to the <xref:Lucene.Net.Analysis.Core.WhiteSpaceTokenizer> but is smart about inter-word punctuation. The term stream looks very much like the way you parse words and punctuation while reading. The major difference between this tokenizer and most other tokenizers shipped with Lucene is that punctuation is tokenized. This is required for the following taggers to operate properly.
The OpenNLP Tokenizer behavior is similar to the <xref:Lucene.Net.Analysis.Core.WhitespaceTokenizer> but is smart about inter-word punctuation. The term stream looks very much like the way you parse words and punctuation while reading. The major difference between this tokenizer and most other tokenizers shipped with Lucene is that punctuation is tokenized. This is required for the following taggers to operate properly.

The OpenNLP taggers annotate terms using the <xref:Lucene.Net.Analysis.TokenAttributes.ITypeAttribute>.

Expand Down
22 changes: 11 additions & 11 deletions src/Lucene.Net.Replicator/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ application should publish an [IndexAndTaxonomyRevision](xref:Lucene.Net.Replica
When the replication client detects that there is a newer revision available, it copies the files of the revision and
then invokes the handler to complete the operation (e.g. copy the files to the index directory, sync them, reopen an
index reader etc.). By default, only files that do not exist in the handler's
[current revision files](xref:Lucene.Net.Replicator.IReplicationHandler.html#Lucene_Net_Replicator_IReplicationHandler_CurrentRevisionFiles) are copied,
[current revision files](xref:Lucene.Net.Replicator.IReplicationHandler#Lucene_Net_Replicator_IReplicationHandler_CurrentRevisionFiles) are copied,
however this can be overridden by extending the client.

<!-- Old Code Sample - not sure whether this is useful
Expand Down Expand Up @@ -83,16 +83,16 @@ public class AspNetCoreReplicationRequest : IReplicationRequest
private readonly HttpRequest request;

// Inject the actual request object in the constructor.
public AspNetCoreReplicationRequest(HttpRequest request)
public AspNetCoreReplicationRequest(HttpRequest request)
=> this.request = request;

// Provide the full path relative to the host.
// In the common case in AspNetCore this should just return the full path, so PathBase + Path are concatenated and returned.
//
//
// The path expected by the ReplicatorService is {context}/{shard}/{action} where:
// - action may be Obtain, Release or Update
// - context is the same context that is provided to the ReplicatorService constructor and defaults to '/replicate'
public string Path
public string Path
=> request.PathBase + request.Path;

// Return values for parameters used by the ReplicatorService
Expand All @@ -103,7 +103,7 @@ public class AspNetCoreReplicationRequest : IReplicationRequest
// - filename: The file name
//
// In this implementation a exception is thrown in the case that parameters are provided multiple times.
public string QueryParam(string name)
public string QueryParam(string name)
=> request.Query[name].SingleOrDefault();
}
```
Expand All @@ -118,7 +118,7 @@ This is also very straight forward.
public class AspNetCoreReplicationResponse : IReplicationResponse
{
private readonly HttpResponse response;

// Inject the actual response object in the constructor.
public AspNetCoreReplicationResponse(HttpResponse response)
=> this.response = response;
Expand Down Expand Up @@ -174,15 +174,15 @@ IndexWriter writer = new IndexWriter(FSDirectory.Open("..."), config);
For the absolute minimal solution we can wire the <xref:Lucene.Net.Replicator.Http.ReplicationService> up on the server side as:

```cs
LocalReplicator replicator = new LocalReplicator();
LocalReplicator replicator = new LocalReplicator();
ReplicatorService service = new ReplicationService(new Dictionary<string, IReplicator>{
["shard_name"] = replicator
}, "/api/replicate");

app.Map("/api/replicate", builder => {
builder.Run(async context => {
await Task.Yield();
service.Perform(context.Request, context.Response);
service.Perform(context.Request, context.Response);
});
});
```
Expand All @@ -200,10 +200,10 @@ On the client side create a new <xref:Lucene.Net.Replicator.Http.HttpReplicator>
```cs
IReplicator replicator = new HttpReplicator("http://{host}:{port}/api/replicate/shard_name");
ReplicationClient client = new ReplicationClient(
replicator,
replicator,
new IndexReplicationHandler(
FSDirectory.Open(...directory...),
() => ...onUpdate...),
FSDirectory.Open(...directory...),
() => ...onUpdate...),
new PerSessionDirectoryFactory(...temp-working-directory...));

//Now either start the Update Thread or do manual pulls periodically.
Expand Down
3 changes: 2 additions & 1 deletion websites/apidocs/docfx.analysis-opennlp.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
}
],
"xref": [
"_site/api/core/xrefmap.yml"
"_site/api/core/xrefmap.yml",
"_site/api/analysis-common/xrefmap.yml"
],
"dest": "_site/api/analysis-opennlp",
"globalMetadataFiles": [
Expand Down
3 changes: 2 additions & 1 deletion websites/apidocs/docfx.analysis-smartcn.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
}
],
"xref": [
"_site/api/core/xrefmap.yml"
"_site/api/core/xrefmap.yml",
"_site/api/analysis-common/xrefmap.yml"
],
"dest": "_site/api/analysis-smartcn",
"globalMetadataFiles": [
Expand Down
1 change: 1 addition & 0 deletions websites/apidocs/docfx.core.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
],
"xref": [
"_site/api/codecs/xrefmap.yml",
"_site/api/analysis-common/xrefmap.yml",
"https://learn.microsoft.com/en-us/dotnet/.xrefmap.json"
],
"dest": "_site/api/core",
Expand Down
4 changes: 3 additions & 1 deletion websites/apidocs/docfx.demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
}
],
"xref": [
"_site/api/core/xrefmap.yml"
"_site/api/core/xrefmap.yml",
"_site/api/queryparser/xrefmap.yml",
"_site/api/analysis-common/xrefmap.yml",
],
"dest": "_site/api/demo",
"globalMetadataFiles": [
Expand Down
3 changes: 2 additions & 1 deletion websites/apidocs/docfx.highlighter.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
}
],
"xref": [
"_site/api/core/xrefmap.yml"
"_site/api/core/xrefmap.yml",
"_site/api/icu/xrefmap.yml"
],
"dest": "_site/api/highlighter",
"globalMetadataFiles": [
Expand Down
3 changes: 2 additions & 1 deletion websites/apidocs/docfx.icu.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
}
],
"xref": [
"_site/api/core/xrefmap.yml"
"_site/api/core/xrefmap.yml",
"_site/api/analysis-common/xrefmap.yml"
],
"dest": "_site/api/icu",
"globalMetadataFiles": [
Expand Down
11 changes: 8 additions & 3 deletions websites/apidocs/docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ $DocFxJsonContent._luceneNetRel = $BaseUrl + "/"
$DocFxJsonContent | ConvertTo-Json -depth 100 | Set-Content $DocFxGlobalJson

# NOTE: The order of these depends on if one of the projects requries the xref map of another, normally all require the core xref map
# Some might also be duplicated; this is intentional - do not remove duplicates!
# This is because of circular dependencies between projects' xref maps.
$DocFxJsonMeta = @(
"docfx.core.json",
"docfx.codecs.json",
"docfx.core.json",
"docfx.analysis-common.json",
"docfx.analysis-kuromoji.json",
"docfx.analysis-morfologik.json",
Expand All @@ -124,8 +126,8 @@ $DocFxJsonMeta = @(
"docfx.expressions.json",
"docfx.facet.json",
"docfx.grouping.json",
"docfx.highlighter.json",
"docfx.icu.json",
"docfx.highlighter.json",
"docfx.join.json",
"docfx.memory.json",
"docfx.misc.json",
Expand All @@ -136,7 +138,10 @@ $DocFxJsonMeta = @(
"docfx.spatial.json",
"docfx.suggest.json",
"docfx.test-framework.json",
"docfx.demo.json"
"docfx.demo.json",
# intentional duplicates
"docfx.codecs.json",
"docfx.core.json"
)
$DocFxJsonSite = Join-Path -Path $ApiDocsFolder "docfx.site.json"

Expand Down

0 comments on commit 1eb0638

Please sign in to comment.