Skip to content

Commit 0be1cbf

Browse files
committed
// CutOffPhraseAction
// nuget
1 parent a3469f6 commit 0be1cbf

4 files changed

Lines changed: 13 additions & 14 deletions

File tree

Action/CorpusExplorer.Sdk.Action/CutOffPhraseAction.cs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,28 @@
22
using CorpusExplorer.Sdk.Model;
33
using CorpusExplorer.Sdk.Utils.DataTableWriter.Abstract;
44
using CorpusExplorer.Sdk.ViewModel;
5-
using System;
6-
using System.Collections.Generic;
7-
using System.Linq;
8-
using System.Text;
9-
using System.Threading.Tasks;
105

116
namespace CorpusExplorer.Sdk.Action
127
{
138
public class CutOffPhraseAction : IAction
149
{
15-
public string Action => "cut-off-phrase";
10+
public string Action => "cutoff-phrase";
1611

17-
public string Description => "cut-off-phrase [LAYER] [QUERY 1] [QUERY 2] - search on [LAYER] in one sentence and prints out the sequence betweet [Q1/2]";
12+
public string Description => "cutoff-phrase [LAYER1] [QUERY 1] [LAYER2] [QUERY 2] - search on [LAYER1/2] in one sentence and prints out the sequence betweet [Q1/2]";
1813

1914
public void Execute(Selection selection, string[] args, AbstractTableWriter writer)
2015
{
21-
if(args.Length != 3)
16+
if(args.Length != 4)
2217
return;
2318

2419
var vm = new CutOffPhraseViewModel { Selection = selection };
25-
vm.LayerDisplayname = args[0];
20+
vm.LayerDisplayname1 = args[0];
2621
vm.LayerQuery1 = args[1];
27-
vm.LayerQuery2 = args[2];
22+
vm.LayerDisplayname2 = args[2];
23+
vm.LayerQuery2 = args[3];
2824
vm.Execute();
2925

30-
writer.WriteTable(vm.GetDataTable());
26+
writer.WriteTable(vm.GetUniqueDataTableCutOffPhrase());
3127
}
3228
}
3329
}

CorpusExplorer.Terminal.Console.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@
192192
<PackageReference Include="Newtonsoft.Json">
193193
<Version>13.0.3</Version>
194194
</PackageReference>
195+
<PackageReference Include="System.Security.Permissions">
196+
<Version>9.0.6</Version>
197+
</PackageReference>
195198
</ItemGroup>
196199
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
197200
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

DotNet5/CorpusExplorer.Terminal.Console.DotNet5/CorpusExplorer.Terminal.Console.DotNet5.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
<PackageReference Include="K4os.Compression.LZ4" Version="1.3.8" />
8686
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.8" />
8787
<PackageReference Include="K4os.Hash.xxHash" Version="1.0.8" />
88-
<PackageReference Include="Microsoft.OpenApi" Version="1.6.24" />
88+
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0" />
8989
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
9090
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
91-
<PackageReference Include="System.Security.Permissions" Version="9.0.6" />
91+
<PackageReference Include="System.Security.Permissions" Version="9.0.7" />
9292
</ItemGroup>
9393

9494
<ItemGroup>

Web/Abstract/AbstractWebService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ where actionFilter.Check(action.Action)
8888
public void Run(AbstractWaitBehaviour waitBehaviour = null, Action<Task> continueWith = null)
8989
{
9090
System.Console.Write($"SERVER {Url} ...");
91-
_documentation = AppendDefaultDocumentation(GetDocumentation()).ConvertToJson();
91+
_documentation = OpenApiHelper.ConvertToJson(AppendDefaultDocumentation(GetDocumentation()));
9292

9393
_server = new Server(_ip, _port, OpenApiRoute, continueWith) { Timeout = _timeout };
9494
_server.AddEndpoint(HttpMethod.Get, "/execute/actions/", ExecuteActionsRoute);

0 commit comments

Comments
 (0)