PaliWordFormResource.php 660 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Resources\V3;
  3. use Illuminate\Http\Request;
  4. /**
  5. * 一个词根及其在三藏里出现过的词形(`word_indices` 表的计数)。
  6. *
  7. * `count` 是该词形的总出现次数,`bold` 是其中以黑体出现的次数(注释书里被解释的词)。
  8. */
  9. class PaliWordFormResource extends BaseResource
  10. {
  11. /**
  12. * @return array{
  13. * base: string,
  14. * forms: list<array{word: string, count: int, bold: int}>
  15. * }
  16. */
  17. public function toArray(Request $request): array
  18. {
  19. return [
  20. 'base' => (string) $this['base'],
  21. 'forms' => $this['forms'],
  22. ];
  23. }
  24. }