Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Takenet.Textc.Samples/bin/Debug/netcoreapp2.1/Takenet.Textc.Samples.dll",
"args": [],
"cwd": "${workspaceFolder}/Takenet.Textc.Samples",
"console": "externalTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
15 changes: 15 additions & 0 deletions src/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Takenet.Textc.Samples/Takenet.Textc.Samples.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -1,72 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6F398506-FC95-45E1-B9AD-1E4A205C33FA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Takenet.Textc.Extensions.Redis</RootNamespace>
<AssemblyName>Takenet.Textc.Extensions.Redis</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworks>netstandard2.0;net451</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="StackExchange.Redis, Version=1.0.316.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\StackExchange.Redis.1.0.488\lib\net45\StackExchange.Redis.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="RedisRequestContext.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Takenet.Textc\Takenet.Textc.csproj">
<Project>{875df2a3-f0cd-4245-820b-ca0caf0565a6}</Project>
<Name>Takenet.Textc</Name>
</ProjectReference>
<ProjectReference Include="..\Takenet.Textc\Takenet.Textc.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<None Include="Takenet.Textc.Extensions.Redis.nuspec" />
<PackageReference Include="StackExchange.Redis" Version="1.2.6" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
6 changes: 0 additions & 6 deletions src/Takenet.Textc.Samples/App.config

This file was deleted.

152 changes: 76 additions & 76 deletions src/Takenet.Textc.Samples/Program.cs
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Takenet.Textc.Csdl;
using Takenet.Textc.Processors;

namespace Takenet.Textc.Samples
{
class Program
{
static void Main(string[] args)
{
MainAsync(args).Wait();
}

static async Task MainAsync(string[] args)
{
ITextProcessor textProcessor;

Console.WriteLine("Select the sample: ");
Console.WriteLine("1. Calculator");
Console.WriteLine("2. Calendar");
Console.WriteLine("3. Pizza");

switch (Console.ReadLine()??"".Trim())
{
case "2":
Console.WriteLine("Starting the calendar...");
textProcessor = Calendar2.CreateTextProcessor();
break;

case "3":
Console.WriteLine("Starting the pizza...");
textProcessor = Pizza.CreateTextProcessor();
break;

default:
Console.WriteLine("Starting the calculator...");
textProcessor = Calculator.CreateTextProcessor();
break;
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Takenet.Textc.Csdl;
using Takenet.Textc.Processors;
namespace Takenet.Textc.Samples
{
class Program
{
static async Task Main(string[] args)
{
await MainAsync(args);
}
static async Task MainAsync(string[] args)
{
ITextProcessor textProcessor;
Console.WriteLine("Select the sample: ");
Console.WriteLine("1. Calculator");
Console.WriteLine("2. Calendar");
Console.WriteLine("3. Pizza");
switch (Console.ReadLine()??"".Trim())
{
case "2":
Console.WriteLine("Starting the calendar...");
textProcessor = Calendar2.CreateTextProcessor();
break;
case "3":
Console.WriteLine("Starting the pizza...");
textProcessor = Pizza.CreateTextProcessor();
break;
default:
Console.WriteLine("Starting the calculator...");
textProcessor = Calculator.CreateTextProcessor();
break;
}

Console.Clear();

// Creates an empty context
var context = new RequestContext();

string inputText;
do
{
Console.WriteLine();
Console.Write("> ");
inputText = Console.ReadLine();

var sw = Stopwatch.StartNew();

try
{
await textProcessor.ProcessAsync(inputText, context, CancellationToken.None);
}
catch (MatchNotFoundException)
{
Console.WriteLine("There's no match for the specified input");
}
catch (ArgumentException)
{
break;
}

sw.Stop();

#if DEBUG
Console.WriteLine("Elapsed: {0} ms ({1} ticks)", sw.ElapsedMilliseconds, sw.ElapsedTicks);
#endif

} while (!string.IsNullOrWhiteSpace(inputText));

}
}
}
var context = new RequestContext();
string inputText;
do
{
Console.WriteLine();
Console.Write("> ");
inputText = Console.ReadLine();
var sw = Stopwatch.StartNew();
try
{
await textProcessor.ProcessAsync(inputText, context, CancellationToken.None);
}
catch (MatchNotFoundException)
{
Console.WriteLine("There's no match for the specified input");
}
catch (ArgumentException)
{
break;
}
sw.Stop();
#if DEBUG
Console.WriteLine("Elapsed: {0} ms ({1} ticks)", sw.ElapsedMilliseconds, sw.ElapsedTicks);
#endif
} while (!string.IsNullOrWhiteSpace(inputText));
}
}
}
36 changes: 0 additions & 36 deletions src/Takenet.Textc.Samples/Properties/AssemblyInfo.cs

This file was deleted.

Loading