Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
f35ca992
Commit
f35ca992
authored
Mar 10, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Telematica ass2: finished report.
parent
e583dcd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
telematica/ass2/report.tex
telematica/ass2/report.tex
+8
-1
No files found.
telematica/ass2/report.tex
View file @
f35ca992
...
@@ -80,7 +80,14 @@ front of the function call. We can safely do this because we handle any
...
@@ -80,7 +80,14 @@ front of the function call. We can safely do this because we handle any
failures manually. The two most probable reasons for a ``bad request'' to occur,
failures manually. The two most probable reasons for a ``bad request'' to occur,
are the lack of an internet connection and the invalidness of a specified
are the lack of an internet connection and the invalidness of a specified
source/target language. Since both are critical for the program's ability to
source/target language. Since both are critical for the program's ability to
function correctly, we have chosen to end the program after a bad request.
function correctly, we have chosen to end the program after a bad request. If
the request is succesful, we use the built in PHP function
\texttt
{
json
\_
decode
}
to parse the response. The converts the JSON object into an associative array,
form which we can easily extract the translation:
\begin{verbatim}
return
$
response
[
"data"
][
"translations"
][
0
][
"translatedText"
]
;
\end
{
verbatim
}
% }}}
% }}}
\end
{
document
}
\end
{
document
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment