-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
511d53a
commit ad67c1a
Showing
11 changed files
with
137 additions
and
108 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...yzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Factories/ConsoleDatabaseReaderFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using TextAnalyzer.Web.ConsoleClient.Interface; | ||
using TextAnalyzer.Web.ConsoleClient.Readers; | ||
|
||
namespace TextAnalyzer.Web.ConsoleClient.Factories | ||
{ | ||
public class ConsoleDatabaseReaderFactory : IReaderFactory | ||
{ | ||
public IReader Create() | ||
{ | ||
Console.WriteLine("Database Connection String: "); | ||
|
||
var connectionString = Console.ReadLine(); | ||
|
||
Console.WriteLine("Document Name: "); | ||
|
||
var documentName = Console.ReadLine(); | ||
|
||
return new DatabaseReader(connectionString, documentName); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...analyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Factories/ConsoleFileReaderFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using TextAnalyzer.Web.ConsoleClient.Interface; | ||
using TextAnalyzer.Web.ConsoleClient.Readers; | ||
|
||
namespace TextAnalyzer.Web.ConsoleClient.Factories | ||
{ | ||
public class ConsoleFileReaderFactory : IReaderFactory | ||
{ | ||
public IReader Create() | ||
{ | ||
Console.WriteLine("Document File Path: "); | ||
|
||
var filePath = Console.ReadLine(); | ||
|
||
return new FileReader(filePath); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...nalyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Factories/ConsoleInputReaderFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using TextAnalyzer.Web.ConsoleClient.Interface; | ||
using TextAnalyzer.Web.ConsoleClient.Readers; | ||
|
||
namespace TextAnalyzer.Web.ConsoleClient.Factories | ||
{ | ||
public class ConsoleInputReaderFactory : IReaderFactory | ||
{ | ||
public IReader Create() | ||
{ | ||
Console.WriteLine("Document Name: "); | ||
|
||
var name = Console.ReadLine(); | ||
|
||
Console.WriteLine("Document Text: "); | ||
|
||
var text = Console.ReadLine(); | ||
|
||
return new InputReader(name, text); | ||
} | ||
} | ||
} |
42 changes: 0 additions & 42 deletions
42
text-analyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Implementation/ConsoleReader.cs
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
text-analyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Implementation/DatabaseReader.cs
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
text-analyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Implementation/ReaderFactory.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
text-analyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Readers/DatabaseReader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace TextAnalyzer.Web.ConsoleClient.Readers | ||
{ | ||
public class DatabaseReader : IReader | ||
{ | ||
private const string DefaultDocumentTableName = "Documents"; | ||
private const string DefaultDocumentNameField = "Name"; | ||
private const string DefaultDocumentTextField = "Text"; | ||
|
||
public DatabaseReader(string connectionString, | ||
string documentName, | ||
string documentTableName = DefaultDocumentTableName, | ||
string documentNameField = DefaultDocumentNameField, | ||
string documentTextField = DefaultDocumentTextField) | ||
{ | ||
ConnectionString = connectionString; | ||
DocumentName = documentName; | ||
DocumentTableName = documentTableName; | ||
DocumentNameField = documentNameField; | ||
DocumentTextField = documentTextField; | ||
} | ||
|
||
public string ConnectionString { get; } | ||
|
||
public string DocumentName { get; } | ||
|
||
public string DocumentTableName { get; } | ||
|
||
public string DocumentNameField { get; } | ||
|
||
public string DocumentTextField { get; } | ||
|
||
public Document Read() | ||
{ | ||
// TODO: Create DB connection read, close DB connection | ||
|
||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
text-analyzer/src/Clients/TextAnalyzer.Web.ConsoleClient/Readers/InputReader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace TextAnalyzer.Web.ConsoleClient.Readers | ||
{ | ||
public class InputReader : IReader | ||
{ | ||
public InputReader(string name, string text) | ||
{ | ||
Name = name; | ||
Text = text; | ||
} | ||
|
||
public string Name { get; } | ||
|
||
public string Text { get; } | ||
|
||
public Document Read() | ||
{ | ||
return new Document(Name, Text); | ||
} | ||
} | ||
} |