Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Major Project Handcrafted
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
jonathan.poalses
Major Project Handcrafted
Commits
f78d0f9a
Commit
f78d0f9a
authored
May 03, 2023
by
Jonathan Poalses
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
392704d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
dialect_nlp.clj
src/poalses/jonathan/dialect/dialect_nlp.clj
+14
-4
No files found.
src/poalses/jonathan/dialect/dialect_nlp.clj
View file @
f78d0f9a
...
...
@@ -70,11 +70,21 @@
(
defn
detect-sentence-dialect
[
sentence
]
(
let
[
token-text
(
dl/text
(
dl/tokens
sentence
))
dialects1
(
if
(
some
australian-words
token-text
)
:australian
(
when
((
apply
some-fn
australian-predicates
)
sentence
)
:australian
))
dialects2
(
if
(
some
scottish-words
token-text
)
:scottish
(
when
((
apply
some-fn
scottish-predicates
)
sentence
)
:scottish
))
dialects3
(
if
(
some
american-words
token-text
)
:american
(
when
((
apply
some-fn
american-predicates
)
sentence
)
:american
))
dialects1
(
if
(
some
australian-words
token-text
)
:australian
(
when
((
apply
some-fn
australian-predicates
)
sentence
)
:australian
))
dialects2
(
if
(
some
scottish-words
token-text
)
:scottish
(
when
((
apply
some-fn
scottish-predicates
)
sentence
)
:scottish
))
dialects3
(
if
(
some
american-words
token-text
)
:american
(
when
((
apply
some-fn
american-predicates
)
sentence
)
:american
))
dialects
(
remove
nil?
[
dialects1
dialects2
dialects3
])]
(
if
(
empty?
dialects
)
[
:standard
]
dialects
)))
(
if
(
empty?
dialects
)
[
:standard
]
dialects
)))
(
cond
)
;; Take a text sample and separate it into its sentences, then for each sentence find its dialects, and return the most common dialect
...
...
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