-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBX-6649: Added support for spell checking
- Loading branch information
Showing
6 changed files
with
155 additions
and
6 deletions.
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
src/contracts/Repository/Values/Content/Query/Spellcheck.php
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,31 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\Core\Repository\Values\Content\Query; | ||
|
||
use eZ\Publish\API\Repository\Values\ValueObject; | ||
|
||
final class Spellcheck extends ValueObject | ||
Check failure on line 13 in src/contracts/Repository/Values/Content/Query/Spellcheck.php GitHub Actions / Unit tests & SQLite integration tests (7.4)
Check failure on line 13 in src/contracts/Repository/Values/Content/Query/Spellcheck.php GitHub Actions / Unit tests & SQLite integration tests (8.0)
Check failure on line 13 in src/contracts/Repository/Values/Content/Query/Spellcheck.php GitHub Actions / Unit tests & SQLite integration tests (8.1)
|
||
{ | ||
/** | ||
* Search phrase. Typically from search input. | ||
* | ||
* @var string | ||
*/ | ||
private string $query; | ||
|
||
public function __construct(string $query) | ||
{ | ||
$this->query = $query; | ||
} | ||
|
||
public function getQuery(): string | ||
{ | ||
return $this->query; | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
src/contracts/Repository/Values/Content/Search/SpellcheckResult.php
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,42 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\Core\Repository\Values\Content\Search; | ||
|
||
final class SpellcheckResult | ||
{ | ||
/** | ||
* Query with applied corrections. | ||
* | ||
* @var string | ||
*/ | ||
private ?string $query; | ||
|
||
/** | ||
* Flag indicating that corrections has been applied to input query. | ||
* | ||
* @var bool | ||
*/ | ||
private bool $incorrect; | ||
|
||
public function __construct(?string $query, bool $incorrect = true) | ||
{ | ||
$this->query = $query; | ||
$this->incorrect = $incorrect; | ||
} | ||
|
||
public function getQuery(): ?string | ||
{ | ||
return $this->query; | ||
} | ||
|
||
public function isIncorrect(): bool | ||
{ | ||
return $this->incorrect; | ||
} | ||
} |
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