-
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
146 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
26 changes: 26 additions & 0 deletions
26
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,26 @@ | ||
<?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 Ibexa\Contracts\Core\Repository\Values\ValueObject; | ||
|
||
final class Spellcheck extends ValueObject | ||
{ | ||
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
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
<?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. | ||
*/ | ||
private ?string $query; | ||
|
||
/** | ||
* Flag indicating that corrections has been applied to input query. | ||
*/ | ||
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