Skip to content

Wraps string features into WordDatatypes #8127

@videlec

Description

@videlec

Python has low-level operations for strings and we should allow them for words. For example

sage: sage: s = "ma maman est magique"
sage: s.split(' ')
['ma', 'maman', 'est', 'magique']
sage: s.split('ma')
['', ' ', '', 'n est ', 'gique']

The patch implements split and partition for words

sage: w = Word("ma maman est magique")
sage: w.split(' ')
[word: ma, word: maman, word: est, word: magique]
sage: w.split('ma')
[word: , word:  , word: , word: n est , word: gique]

CC: @seblabbe @sagetrac-sage-combinat

Component: combinatorics

Keywords: string, word

Author: Vincent Delecroix

Reviewer: Sébastien Labbé

Merged: sage-4.3.3.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/8127

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions