Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
corpus2
Commits
1e5502b4
Commit
1e5502b4
authored
Apr 16, 2013
by
Adam Radziszewski
Browse files
Options
Downloads
Patches
Plain Diff
fx premorph writer: escape XML entities
parent
a0b4cb98
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
libcorpus2/io/premorphwriter.cpp
+6
-2
6 additions, 2 deletions
libcorpus2/io/premorphwriter.cpp
with
7 additions
and
3 deletions
CMakeLists.txt
+
1
−
1
View file @
1e5502b4
...
...
@@ -2,7 +2,7 @@ PROJECT(Corpus2Library)
set
(
corpus2_ver_major
"1"
)
set
(
corpus2_ver_minor
"3"
)
set
(
corpus2_ver_patch
"
1
"
)
set
(
corpus2_ver_patch
"
2
"
)
cmake_minimum_required
(
VERSION 2.8.0
)
...
...
This diff is collapsed.
Click to expand it.
libcorpus2/io/premorphwriter.cpp
+
6
−
2
View file @
1e5502b4
...
...
@@ -17,6 +17,9 @@ or FITNESS FOR A PARTICULAR PURPOSE.
#include
<libcorpus2/io/premorphwriter.h>
#include
<boost/foreach.hpp>
// for entity encoding
#include
<libcorpus2/io/xcescommon.h>
namespace
Corpus2
{
bool
PremorphWriter
::
registered
=
TokenWriter
::
register_writer
<
PremorphWriter
>
(
...
...
@@ -42,14 +45,15 @@ PremorphWriter::~PremorphWriter()
void
PremorphWriter
::
write_token
(
const
Token
&
t
)
{
os
()
<<
PwrNlp
::
Whitespace
::
to_whitespace
(
t
.
wa
())
<<
t
.
orth_utf8
();
os
()
<<
PwrNlp
::
Whitespace
::
to_whitespace
(
t
.
wa
());
encode_xml_entities_into
(
os
(),
t
.
orth_utf8
());
}
void
PremorphWriter
::
write_sentence
(
const
Sentence
&
s
)
{
os
()
<<
"<chunk type=
\"
s
\"
>"
;
if
(
!
s
.
tokens
().
empty
())
{
os
()
<<
s
[
0
]
->
orth_utf8
();
encode_xml_entities_into
(
os
()
,
s
[
0
]
->
orth_utf8
()
)
;
}
for
(
size_t
i
=
1
;
i
<
s
.
tokens
().
size
();
++
i
)
{
write_token
(
*
s
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment