com.kotlinnlp.tokensencoder.morpho.extractors.PunctuationFeaturesExtractor.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tokensencoder Show documentation
Show all versions of tokensencoder Show documentation
TokensEncoder is a very simple to use tokens encoder library which uses neural networks from SimpleDNN.
/* Copyright 2017-present The KotlinNLP Authors. All Rights Reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* ------------------------------------------------------------------*/
package com.kotlinnlp.tokensencoder.morpho.extractors
import com.kotlinnlp.linguisticdescription.morphology.morphologies.discourse.Punctuation
/**
* Extract the features from the given [morphology].
*
* @param morphology the morphology
*/
class PunctuationFeaturesExtractor(private val morphology: Punctuation) : MorphoFeaturesExtractor {
/**
* Return a list of features.
*/
override fun get(): List = listOf(
"p:%s".format(this.morphology.type),
"p:%s l:%s".format(this.morphology.type, this.morphology.lemma)
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy