SynonymAnalyzerInterface.php 766 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Search\Api;
  7. /**
  8. * @api
  9. * @since 100.1.0
  10. */
  11. interface SynonymAnalyzerInterface
  12. {
  13. /**
  14. * Get synonyms for specified phrase
  15. *
  16. * For phrase: "Elizabeth is the English queen" example output is an array of arrays containing synonyms for each
  17. * word in the phrase:
  18. *
  19. * [
  20. * 0 => [ 0 => "elizabeth" ],
  21. * 1 => [ 0 => "is" ],
  22. * 2 => [ 0 => "the" ],
  23. * 3 => [ 0 => "british", 1 => "english" ],
  24. * 4 => [ 0 => "queen", 1 => "monarch" ]
  25. * ]
  26. *
  27. * @param string $phrase
  28. * @return array
  29. * @since 100.1.0
  30. */
  31. public function getSynonymsForPhrase($phrase);
  32. }