Skip to content

Commit

Permalink
Merge pull request #2 from radoslawik/docx-doc-support
Browse files Browse the repository at this point in the history
Add docx and doc support
  • Loading branch information
radoslawik committed Mar 25, 2022
2 parents 552f3d5 + d03e0dd commit ffd59f7
Show file tree
Hide file tree
Showing 60 changed files with 964 additions and 710 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.0.0] - 25/03/2022

### Added
- Support for docx and doc

### Changed
- Improved status bar responsivity

## [0.2.0] - 15/05/2021

### Added
Expand Down
10 changes: 10 additions & 0 deletions InDepthSearch.Core/Enums/AppLanguage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

namespace InDepthSearch.Core.Enums
{
public enum AppLanguage
{
English,
Polski,
Francais
}
}
10 changes: 10 additions & 0 deletions InDepthSearch.Core/Enums/ImageExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

namespace InDepthSearch.Core.Enums
{
public enum ImageExtension
{
Jpg,
Png,
Bmp
}
}
11 changes: 11 additions & 0 deletions InDepthSearch.Core/Enums/MatchConfidence.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace InDepthSearch.Core.Enums
{
public enum MatchConfidence
{
High, // found exact expression
Medium, // found the all the words from the expression
Low // found part of the words from the expression
}

}
11 changes: 11 additions & 0 deletions InDepthSearch.Core/Enums/RecognitionLanguage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace InDepthSearch.Core.Enums
{
public enum RecognitionLanguage
{
Default,
English,
French,
Polish
}
}
11 changes: 11 additions & 0 deletions InDepthSearch.Core/Enums/RecognitionPrecision.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace InDepthSearch.Core.Enums
{
public enum RecognitionPrecision
{
Default,
High,
Medium,
Low
}
}
11 changes: 11 additions & 0 deletions InDepthSearch.Core/Enums/SearchInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace InDepthSearch.Core.Enums
{
public enum SearchInfo
{
Unknown,
Init,
Run,
NoResults,
}
}
11 changes: 11 additions & 0 deletions InDepthSearch.Core/Enums/SearchStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace InDepthSearch.Core.Enums
{
public enum SearchStatus
{
Unknown,
Ready,
Initializing,
Running,
}
}
10 changes: 10 additions & 0 deletions InDepthSearch.Core/Enums/Theme.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

namespace InDepthSearch.Core.Enums
{
public enum Theme
{
Default,
Light,
Dark,
}
}
6 changes: 3 additions & 3 deletions InDepthSearch.Core/InDepthSearch.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<TargetFramework>net5.0</TargetFramework>
<Version>0.2.0</Version>
<Version>1.0.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.13.0" />
<PackageReference Include="Tesseract" Version="4.1.1" />
<PackageReference Include="Docnet.Core" Version="2.2.0" />
<PackageReference Include="ReactiveUI.Fody" Version="13.1.1" />
<PackageReference Include="ReactiveUI.Fody" Version="13.3.2" />
<PackageReference Include="ReactiveUI.Validation" Version="2.1.1" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.2" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 16 additions & 0 deletions InDepthSearch.Core/Managers/Interfaces/IResultManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

using InDepthSearch.Core.Models;
using System.Collections.ObjectModel;

namespace InDepthSearch.Core.Managers.Interfaces
{
public interface IResultManager
{
ObservableCollection<QueryResult> Results { get; }
ResultStats Stats { get; }
bool ItemsReady { get; set; }
void Reinitialize();
void AddResult(QueryResult res);
void SetItemsReady(bool ready);
}
}
2 changes: 1 addition & 1 deletion InDepthSearch.Core/Models/QueryResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using InDepthSearch.Core.Types;
using InDepthSearch.Core.Enums;

namespace InDepthSearch.Core.Models
{
Expand Down
11 changes: 4 additions & 7 deletions InDepthSearch.Core/Models/ResultStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ namespace InDepthSearch.Core.Models
{
public class ResultStats : ReactiveObject
{
public ResultStats(string filesAnalyzed, bool isReady, int pagesAnalyzed, string executionTime)
public ResultStats()
{
FilesAnalyzed = filesAnalyzed;
IsReady = isReady;
PagesAnalyzed = pagesAnalyzed;
ExecutionTime = executionTime;
FilesAnalyzed = "";
PagesAnalyzed = 0;
ExecutionTime = "";
}

[Reactive]
public string FilesAnalyzed { get; set; }
[Reactive]
public bool IsReady { get; set; }
[Reactive]
public int PagesAnalyzed { get; set; }
[Reactive]
public string ExecutionTime { get; set; }
Expand Down
27 changes: 14 additions & 13 deletions InDepthSearch.Core/Models/SearchOptions.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
using InDepthSearch.Core.Types;
using InDepthSearch.Core.Enums;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;

namespace InDepthSearch.Core.Models
{
public class SearchOptions : ReactiveObject
{
public SearchOptions(string path, string keyword, RecognitionPrecision selectedPrecisionOCR, RecognitionLanguage selectedLanguageOCR,
bool caseSensitive, bool useOCR, bool useSubfolders, bool usePDF, bool useDOCX, bool useODT)
public SearchOptions()
{
Path = path;
Keyword = keyword;
SelectedPrecisionOCR = selectedPrecisionOCR;
SelectedLanguageOCR = selectedLanguageOCR;
CaseSensitive = caseSensitive;
UseOCR = useOCR;
UseSubfolders = useSubfolders;
UsePDF = usePDF;
UseDOCX = useDOCX;
UseODT = useODT;
UseOCR = true;
UsePDF = true;
Path = "";
Keyword = "";
SelectedLanguageOCR = RecognitionLanguage.Default;
SelectedPrecisionOCR = RecognitionPrecision.Default;
}

[Reactive]
Expand All @@ -28,10 +23,16 @@ public class SearchOptions : ReactiveObject
public RecognitionPrecision SelectedPrecisionOCR { get; set; }
public RecognitionLanguage SelectedLanguageOCR { get; set; }
public bool CaseSensitive { get; set; }
[Reactive]
public bool UseOCR { get; set; }
public bool UseSubfolders { get; set; }
[Reactive]
public bool UsePDF { get; set; }
[Reactive]
public bool UseDOCX { get; set; }
[Reactive]
public bool UseODT { get; set; }
[Reactive]
public bool UseDOC { get; set; }
}
}
2 changes: 1 addition & 1 deletion InDepthSearch.Core/Services/Interfaces/IAppService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using InDepthSearch.Core.Types;
using InDepthSearch.Core.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
10 changes: 2 additions & 8 deletions InDepthSearch.Core/Services/Interfaces/IOptionService.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using Docnet.Core.Models;
using InDepthSearch.Core.Types;
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using InDepthSearch.Core.Enums;

namespace InDepthSearch.Core.Services.Interfaces
{
public interface IOptionService
{
public (PageDimensions, RenderFlags, PixelFormat, ImageFormat) TranslatePrecision(RecognitionPrecision rp);
public (PageDimensions, RenderFlags, ImageExtension) TranslatePrecision(RecognitionPrecision rp);
public string TranslateLanguage(RecognitionLanguage rl);
}
}
10 changes: 10 additions & 0 deletions InDepthSearch.Core/Services/Interfaces/ISearchService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using InDepthSearch.Core.Enums;
using InDepthSearch.Core.Models;

namespace InDepthSearch.Core.Services.Interfaces
{
public interface ISearchService
{
void Search(string file, SearchOptions searchOptions);
}
}
2 changes: 1 addition & 1 deletion InDepthSearch.Core/Services/Interfaces/IThemeService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using InDepthSearch.Core.Types;
using InDepthSearch.Core.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
15 changes: 0 additions & 15 deletions InDepthSearch.Core/Types/AppLanguage.cs

This file was deleted.

16 changes: 0 additions & 16 deletions InDepthSearch.Core/Types/MatchConfidence.cs

This file was deleted.

16 changes: 0 additions & 16 deletions InDepthSearch.Core/Types/RecognitionLanguage.cs

This file was deleted.

16 changes: 0 additions & 16 deletions InDepthSearch.Core/Types/RecognitionPrecision.cs

This file was deleted.

16 changes: 0 additions & 16 deletions InDepthSearch.Core/Types/SearchInfo.cs

This file was deleted.

16 changes: 0 additions & 16 deletions InDepthSearch.Core/Types/SearchStatus.cs

This file was deleted.

15 changes: 0 additions & 15 deletions InDepthSearch.Core/Types/Theme.cs

This file was deleted.

Loading

0 comments on commit ffd59f7

Please sign in to comment.