You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.4 KiB

5 years ago
  1. #Proyecto Api y Front para Eslema v2
  2. #Sistema Base:
  3. Debian 11
  4. ##Instalacion Apertium
  5. ###Instalamos los repositorios de apertium
  6. ```bash
  7. curl -sS https://apertium.projectjj.com/apt/install-nightly.sh | sudo bash
  8. ```
  9. ###Instalamos apertium
  10. ```bash
  11. sudo apt-get -f install apertium-all-dev
  12. ```
  13. ###Instalamos los paquetes de idioma de Asturiano y Castellano
  14. ```bash
  15. sudo apt-get install apertium-ast
  16. sudo apt-get install apertium-spa
  17. sudo apt-get install apertium-spa-ast
  18. ```
  19. #Desarrollo del API
  20. ##Diseño
  21. El api ira directo a Apertium a traves del controlador pasando la información como JSON.
  22. El apì tendra los siguientes endpoints:
  23. /listPairs -- Lista Pares
  24. /list -- Lista el tipo de informacion
  25. q: type of information to list
  26. pairs (alias for /listPairs)
  27. analyzers/analysers
  28. generators
  29. taggers/disambiguators
  30. /translate -- Traduce el texto
  31. langpair: language pair to use for translation
  32. q: text to translate
  33. markUnknown=no (optional): include this to remove "*" in front of unknown words
  34. deformat: deformatter to be used: one of html (default), txt, rtf
  35. reformat: deformatter to be used: one of html, html-noent (default), txt, rtf
  36. format: if deformatter and reformatter are the same, they can be specified here
  37. [ver formatoos reconocidos]
  38. /translateDoc -- Traduce un archivo
  39. langpair: language pair to use for translation
  40. file: document to translate
  41. markUnknown=no (optional): include this to remove "*" in front of unknown words
  42. /analyze or /analyse -- Analiza el texto morfologicamente
  43. lang: language to use for analysis
  44. q: text to analyze
  45. /generate -- genera formas de superficie??? de un texto
  46. lang: language to use for generation
  47. q: text to generate
  48. /perWord -- Perform morphological tasks per word
  49. lang: language to use for tasks
  50. modes: morphological tasks to perform on text (15 combinations possible - delimit using '+')
  51. tagger/disambig
  52. biltrans
  53. translate
  54. morph
  55. q: text to perform tasks on
  56. /listLanguageNames -- Get localized language names
  57. locale: language to get localized language names in
  58. languages: list of '+' delimited language codes to retrieve localized names for (optional - if not specified, all available codes will be returned)
  59. /calcCoverage -- Get coverage of a language on a text
  60. lang: language to analyze with
  61. q: text to analyze for coverage
  62. /identifyLang -- Return a list of languages with probabilities of the text being in that language. Uses CLD2 if that's installed, otherwise will try any analyser modes.
  63. q: text which you would like to compute probabilities for
  64. /stats -- Return some statistics about pair usage, uptime, portion of time spent actively translating
  65. requests=N (optional): limit period-based stats to last N requests
  66. ## Formatos reconocidos
  67. plain text: -f txt (apertium-destxt)
  68. HTML: -f html or -f html-noent (apertium-deshtml)
  69. html prints non-ASCII chars using entities, html-noent keeps non-ASCII as-is; the difference is in the reformatter
  70. RTF: -f rtf (apertium-desrtf)
  71. OpenOffice.org Writer ODT: -f odt (apertium-desodt)
  72. Microsoft Word DOCX, WXML: -f wxml (apertium-deswxml)
  73. Microsoft Powerpoint PPTX: -f pptx (apertium-despptx)
  74. Microsoft Excel XLSX: -f xlsx (apertium-desxlsx)
  75. QuarkXPress XpressTag: -f xpresstag (apertium-desxpresstag)