Skip to content

Commit

Permalink
Merge pull request #101 from Encamina/@mramos/change-access-modifiers
Browse files Browse the repository at this point in the history
Change some access modifiers
  • Loading branch information
MarioRamosEs authored Mar 20, 2024
2 parents 2a81468 + 95f4589 commit d0ccbb2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<PropertyGroup>
<VersionPrefix>8.1.5</VersionPrefix>
<VersionSuffix>preview-13</VersionSuffix>
<VersionSuffix>preview-14</VersionSuffix>
</PropertyGroup>

<!--
Expand Down
3 changes: 3 additions & 0 deletions src/Encamina.Enmarcha.Bot/Controllers/BotBaseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ protected BotBaseController(IBotFrameworkHttpAdapter adapter, IBot bot)
/// <summary>
/// Handles a request for the bot.
/// </summary>
/// <remarks>
/// This method does not uses a `CancellationToken` because Azure Bot Service would cancel the request if it did not receive a response within 15 seconds.
/// </remarks>
/// <returns>
/// A <see cref="Task"/> that represents the asynchronous operation of handling the request for the bot.
/// </returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ public override string ReadText(Stream stream)
return sb.ToString();
}

private static IEnumerable<TextBlock> GetTextBlocks(Page page)
/// <summary>
/// Extracts <see cref="TextBlock"/> from a given page of a PDF document.
/// </summary>
/// <param name="page">The page from which to extract text blocks.</param>
/// <returns>An enumerable collection of <see cref="TextBlock" /> extracted from the page.</returns>
protected static IEnumerable<TextBlock> GetTextBlocks(Page page)
{
// 1. Extract words
var words = NearestNeighbourWordExtractor.Instance.GetWords(page.Letters);
Expand All @@ -70,7 +75,13 @@ private static IEnumerable<TextBlock> GetTextBlocks(Page page)
return orderedTextBlocks;
}

private static IEnumerable<TextBlock> CleanTextBlocks(PdfDocument document, IEnumerable<TextBlock> textBlocks)
/// <summary>
/// Cleans the extracted text blocks from a PDF document by removing common words that overlap across pages and excluding non-horizontal text.
/// </summary>
/// <param name="document">The PDF document.</param>
/// <param name="textBlocks">The extracted text blocks.</param>
/// <returns>The cleaned text blocks.</returns>
protected static IEnumerable<TextBlock> CleanTextBlocks(PdfDocument document, IEnumerable<TextBlock> textBlocks)
{
var horizontalTextBlocks = textBlocks
.Where(tb => tb.TextOrientation == TextOrientation.Horizontal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ namespace Encamina.Enmarcha.SemanticKernel.Connectors.Document;
/// <summary>
/// Utility class providing methods for working with document connectors.
/// </summary>
internal static class IDocumentConnectorUtils
public static class IDocumentConnectorUtils
{
/// <summary>
/// Gets the default document connector based on the specified file extension.
/// </summary>
/// <param name="fileExtension">The file extension for which to retrieve the connector.</param>
/// <returns>An instance of the default document connector for the specified file extension.</returns>
/// <exception cref="NotSupportedException">Thrown when the file extension is not supported.</exception>
internal static IDocumentConnector GetDefaultDocumentConnector(string fileExtension)
public static IDocumentConnector GetDefaultDocumentConnector(string fileExtension)
{
return fileExtension.ToUpperInvariant() switch
{
Expand Down

0 comments on commit d0ccbb2

Please sign in to comment.